I have a textarea and a button. button on click event i pick text from textarea, wrap it inside dDIV and append to body/previous div…it works fine. But when i enter “?” i replace it with something like “jQuery1501637366954848789_1324305473579″…i cant find why this is happening….Is there anyone who have faced the same ??
This is how i get textarea value
var comment = $("#comment").val();
This is how i wrap it
$('<div class="outer"><div class="inner" id="avatar"><img src="'+avatar+'" width="35" height="35"></div><div class="inner" id="comment-holder"><div id="text"><a href="mailto:'+email+'">'+name+'</a> '+comment+'</div><div class="ago">a second ago</div></div><div class="delete" style="margin-left : 2px;margin-right : 2px;"> </div><br style="clear:both" /></div>')
.insertBefore($('#post-comment'))
.insertAfter(".reply-holder:last")
.fadeIn("slow");
=========================
Got the solution myself….
made changes to ajax request, I dont know what is the relation but it worked
data: "action=save&comment="+temp_comment+"&email="+email+"&name="+name,
with
data: "action=save&comment="+encodeURIComponent(temp_comment)+"&email="+email+"&name="+name,
i am not even using temp_comment variable, Its funny. anyways problem solved 🙂 thanks for ur time..i gonna study this later, there should be some logic behind
This is how jQuery generates JSONP requests.