Skip to content

Commit

Permalink
actualizando el ejemplo final de ajax y demás
Browse files Browse the repository at this point in the history
  • Loading branch information
davsket committed Aug 6, 2013
1 parent c73fb37 commit 77db191
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
Binary file modified res/.DS_Store
Binary file not shown.
9 changes: 5 additions & 4 deletions res/js/artista.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

function getArtist( evt ){
// Enter
if(evt.keycode == 13){
if(evt.keyCode == 13){
requestArtist()
}
}
Expand All @@ -19,11 +19,12 @@
data: {
artist: artistInput.val(),
api_key: '42f75f939105d2110d6a0daf27db431c',
format: 'json'
format: 'json',
method: 'artist.getinfo'
},
// url: '/res/data/lastfm.json'
url: 'http://ws.audioscrobbler.com/2.0/?method=artist.getinfo'
}).done(fillArtistInfo)
url: 'http://ws.audioscrobbler.com/2.0/'
}).done( fillArtistInfo )
}

function fillArtistInfo( jsonData ){
Expand Down
6 changes: 3 additions & 3 deletions res/js/ejemplo1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var a = 2
var b = 3
var c = a + b
var a = 2,
b = 3,
c = a + b
console.log(c) // 5
6 changes: 5 additions & 1 deletion res/js/ejemplo3.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
function max(a,b){
if(a>b){
console.log('este si va a salir')
return a
console.log('esto no va a salir')
}
return b
}
alert(max(2,3)) // 3
max(6,3)
max(1,9)
max(200,200)

12 changes: 7 additions & 5 deletions res/js/ejemplo4.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
var a = 'Hola'
String.prototype.suspensivos = function(){
return this + '...'
}
alert(a.suspensivos()) // 'Hola...'
var a = [1,2,3,2],
sum = 0

for(var i=0; i<a.length;i++){
sum += a[i]
console.log(i, sum)
}

0 comments on commit 77db191

Please sign in to comment.