Log In With Twitter
   
Log In With Facebook
    Login Help   
Username:  Password:  
SomeSongs FAQ Songs Artists Playlists Search Post Song Recent Activity Register First Time?
JavaScript funniness when posting song comment



Jan Krueger
I just posted a comment and got nothing but a JavaScript alert box saying "undefined" (w/o quotes). Reloading the page showed that the comment was saved properly, though.
Looking at the code, it's probably due to the

if (responseJSON) { alert(responseJSON.error); }


in /ssj/js/song.js (function saveComment()). Apparently responseJSON can end up being defined without responseJSON.error being defined.
Posted: 2010-11-28 08:36:42      Edited: 2010-11-28 08:36:53


Lunkhead
Wow, that is a really awesome bug report. I wish I got bug reports with that level of detail from the QA department at my job. ;)

I think you may need to clear your browser cache, or do a hard-refresh of that song.js file. You should see code like this in the saveComment() function:

var responseJSON = transport.responseJSON;
if (responseJSON) {
if (responseJSON.error) {
alert(responseJSON.error);
} else {
if (!hasComment) {
// adding new comment, will show up at end of list, reset start to go to last page
hasComment = true;
start = -1;
}
refreshComments();
}
} else {
alert("Unexpected response, comment may not have been saved");
}
Posted: 2010-11-28 10:59:19      Edited: 2010-11-28 10:59:19


JavaScript funniness when posting song comment

Topics:
Search:
In post:
Posted by:
Topic:
Sort: