Strange jQuery behavior when assigning variable
I have really strange behavior with assigning the value to variable with
jQuery.
function:
function getTrackSpotify() {
var track;
//var title = document.getElementsByTagName('title')[ 0 ];
if($("#radio-track .outgoing").length >0){
alert($("#radio-track .outgoing").length); //SHOWS LENGTH OF COURSE
alert($("#radio-artist .outgoing").text() + " - " + $("#radio-track
.outgoing").text()); // SHOWS TRACK AND ARTIST
track = $("#radio-artist .outgoing").text() + " - " + $("#radio-track
.outgoing").text(); // ASSIGNING THE VALUES TO THE VARIABLE WE SAW
THAT IT SHOWS
}
return track; // empty ................... how??
}
I am coding for 10 hours today, maybe my brains are just burned too much,
and I can't see nothing..
No comments:
Post a Comment