Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript function response in Jquery not working
    primarykey
    data
    text
    <p>I have a form that using ajax to post the comment to video_comment.php then show up the comment live on video page. </p> <p>This is my jquery code:</p> <pre><code>$("input[id*='post_video_playallcomment_']").livequery('click', function(event) { event.preventDefault(); var video_msg = $("#post_message"); var input_id = $(this).attr('id'); var id_split = input_id.split('_'); var video_id = id_split[3]; var comment = $("textarea[id='video_comment']").val(); var response_messages = '#video_response'; if ( comment == '' ) { video_msg.fadeIn(); return false; } video_msg.hide(); user_posting(response_messages, '&lt;?php echo $lang['600']; ?&gt;', 1); reset_chars_counter(); $.post(base_url + '/video_comment.php', { video_id: video_id, comment: comment }, function(response) { if ( response.msg != '' ) { $(response_messages).hide(); user_posting(response_messages, response.msg); $("textarea[id='video_comment']").val(''); } else { $(response_messages).hide(); user_response(response_messages, '&lt;?php echo $lang['587']; ?&gt;'); $(".no_comments").hide(); $("textarea[id='video_comment']").val(''); var bDIV = $("#comments_delimiter"); var cDIV = document.createElement("div"); $(cDIV).html(response.code); $(bDIV).after(cDIV); } }, "json"); }); </code></pre> <p>On video_comment.php, this is the response.code to show up the comment live on video page.</p> <pre><code>echo 'text... echo '&lt;div id="commentplayer"&gt;&lt;/div&gt;'; echo '&lt;script type="text/javascript"&gt;'; echo 'jwplayer("commentplayer").setup({'; echo 'file: "...url",'; echo 'width: "300",'; echo 'height: "225",'; echo 'provider: "http",'; echo 'startparam: "start",'; echo 'wmode: "transparent",'; echo 'controls: "true",'; echo 'stretching: "uniform",'; echo 'primary: "flash",'; echo 'autostart: "false",'; echo 'ga: {}'; echo '});'; echo '&lt;/script&gt;'; echo 'text... </code></pre> <p>I have no problem to get 'text...', but i can't get '&lt;script type="text/javascript"&gt;function...&lt;/script&gt;' to show up live on video page.</p> <p>Help please...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload