Skip to content

Instantly share code, notes, and snippets.

@edinsoncs
Created February 16, 2016 00:57
Show Gist options
  • Save edinsoncs/8e6a70088a1ed60105f3 to your computer and use it in GitHub Desktop.
Save edinsoncs/8e6a70088a1ed60105f3 to your computer and use it in GitHub Desktop.
cv in javascript
//javascript object in function
//cv in jss
var question = prompt('ingresa el nombre');
var micv = {
nombre: 'Edinson',
surname: 'Carranza',
form: function(city){
var title = "Soy de: ";
return title + city;
},
soy: function(jobs) {
var title = "Soy un: ";
return title + jobs;
},
hobbies: function(result){
var title = result.join(' learning IT ');
return title;
},
social: {
title: 'Sigueme en: ',
facebook: 'fb/Ockang',
twitter: 'tw/Ockang',
youtube: 'yt/OckangTv',
instagram: 'ins/Edinsoncs'
},
err: function(err) {
return err;
}
}
function show(){
console.log(micv.nombre + " " + micv.surname);
console.log(micv.form('Peru'));
console.log(micv.soy('Developer Full Stack'));
console.log(micv.hobbies(['jugar','juegos']));
console.log(micv.social.title + "-" + micv.social.facebook + "-" + micv.social.twitter + "-" + micv.social.youtube + "-" + micv.social.instagram);
return micv.nombre + "</br>" + micv.form('Peru') + "</br>" + micv.soy('Developer Full Stack') + "</br>" + micv.hobbies(['jugar','juegos']) + micv.social.title + "-" + micv.social.facebook + "-" + micv.social.twitter + "-" + micv.social.youtube + "-" + micv.social.instagram;
}
function inserHTML(recept){
var a = recept;
var template = "";
if(a == "HTML5" || a == "html5" || a == "Html5") {
template = "<section>" +
"<h1>"+
show() +
"</h1>"+
"</section>";
return template;
}
}
function showError(){
document.write(micv.err('Grave error, lo siento :('));
console.log(micv.err('Grave error, lo siento :('));
}
function verify() {
if(micv.nombre == question) {
//window.print();
var write = document.write(inserHTML('HTML5'));
alert('1');
alert('2');
alert('3');
setTimeout(function(){
window.print();
}, 500);
return show();
}
else {
showError();
}
}
verify();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment