Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I want to thank everyone of you who took their time to answer me with this problem I have. However, the answer came to me after 4 days of struggle and "inventions" :), and it's not a JS or Jquery solution, but a simple logic in the file.</p> <p>Originally, I call my functions and plugins at the beginning of the document in "head" tag, like any other programmer out here (there are exceptions also ).</p> <p>Then my visitors open my blog read it and they want to post comments. But there are a lot of comments, and I don't want to scroll the entire page, or use the default scroll bars, simply because they're ugly and we don't have cross browser support to style that, just yet.</p> <p>So I .post() the form with the comment, and simply reload the containing all of them. Naturally .scrollbars() plugin doesn't work. Here come the solution.</p> <p>If I put this :</p> <pre><code>&lt;script&gt;$('.showcoment').scrollbars();&lt;/script&gt; </code></pre> <p>in the beginning of my loaded document (with load() ), will not work, because is not HTML and it's getting removed automatically. BUT !!! If i do this:</p> <pre><code>&lt;div&gt;&lt;script&gt;$('.showcoment').scrollbars();&lt;/script&gt;&lt;/div&gt; </code></pre> <p>at the same beginning of loaded document, MAGIC .... it works. The logic that got me there I found it in the basics of javascript. If your script is inside an HTML element, it will be parsed without any problem.</p> <p>Thank you all again, and I hope my experience will help others.</p>
 

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