problem with prepend(); - it does nothing...
Hi jquery-jedis!
I have an AJAX function success running and want to prepend some html-comments to selected elements. If i alert(); the variable, its perfectly set up. Only it wont prepend(); to the element (or any other like jQuery('body')) as I want it to.
I would really appreciate if someone could give me a hint here...
Here is the code:
- success: function(result)
{
// Define output variable / Define variables
var jsv_output, incrementor;
// Build the html comment for later jquery use of another script
incrementor = 0;
jsv_output = '<!-- JSV_OUTPUT ';
jQuery.each(result, function() {
jsv_output = jsv_output+result[incrementor].code+'||'+result[incrementor].text+',';
incrementor ++;
});
jsv_output = jsv_output+' -->';
jQuery('body').prepend(jsv_output);
}
Im appologizing in advance if its some stupid beginners mistake I could've found on my own through reading documentation. It's just... I'm stuck for a couple of days now and can't figure it out :(