Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript not working in the new part when loading a new part using jquery and HTML 5
    text
    copied!<p>Hi as my title suggest, i use the following code to dynamically load a portion of the page (here left id)</p> <pre><code>function callBackFunctionLoadNextBackInPage(data) { //alert(data); $("#left").fadeTo(100,1); var data = $(data).find( '#left' ); $("#left").html(data); if(supports_history_api()) { history.pushState(null, null, loadNextBackInPage_URL); if(!popEventListnerAdded) { window.addEventListener("popstate", function(e) { loadNextBackInPage(location.href); },false); popEventListnerAdded = true; } } else { } } function loadNextBackInPage(url,parm) { //alert(url); loadNextBackInPage_URL = url; $("#left").fadeTo(100,.2); $.post(url,parm,callBackFunctionLoadNextBackInPage,'html'); } </code></pre> <p>Here is <a href="http://bedupako.com/songs.php" rel="nofollow">an example of how i do it</a> (click on the show details link</p> <p>Problem is:</p> <p>It loads properly... but the javascript is not working. For example: 1. I use a discuss for comments and it doesnt load in the following section</p> <blockquote> <p>Add a Comment using Facebook, Twitter, Yahoo!, DISQUS, OpenID or Anonymus</p> </blockquote> <p>But if you refresh the browser it does load properly... I am loading all the scripts required first only... so why is it not working?</p> <p>Also for example: The SHARE (Click here) button should expand using the following code: </p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; function showHideDiv() { var divstyle = new String(); divstyle = document.getElementById("share").style.display; if(divstyle.toLowerCase()=="block" || divstyle == "") { document.getElementById("share").style.display = 'none'; } else { document.getElementById("share").style.display = 'block'; } } &lt;/script&gt; </code></pre> <p>But it doesnot!... but works if i refresh the page(i.e load the url again)</p> <p>Mainly i want the discuss commenting thing to work. I use the following codes to generate it</p> <pre><code>&lt;div class="entry"&gt; &lt;h2&gt;Add a Comment using Facebook, Twitter, Yahoo!, DISQUS, OpenID or Anonymus &lt;/h2&gt; &lt;p&gt; &lt;div id="disqus_thread"&gt;&lt;/div&gt; &lt;script&gt; /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = '[written here]'; // required: replace example with your forum shortname // The following are highly recommended additional parameters. Remove the slashes in front to use. var disqus_identifier = 'page=show_song_details.php&amp;songid=&lt;?php echo $sid ?&gt;&amp;n=0&amp;back=no'; var disqus_url = '&lt;?php echo $main_root.$_SERVER['REQUEST_URI']; ?&gt;'; var disqus_developer = 1 ; /* * * DON'T EDIT BELOW THIS LINE * * */ (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); &lt;/script&gt; &lt;noscript&gt;Please enable JavaScript to view the &lt;a href="http://disqus.com/?ref_noscript"&gt;comments powered by Disqus.&lt;/a&gt;&lt;/noscript&gt; &lt;/p&gt; &lt;/div&gt; </code></pre>
 

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