Note that there are some explanatory texts on larger screens.

plurals
  1. POGrails JQuery PeriodicUpdater
    primarykey
    data
    text
    <p>I want to use a periodic Updater in jQuery to update a chat div periodically. Therefore I include the jQuery library in the layout file with:</p> <pre><code>&lt;g:javascript library="jquery" plugin="jquery"/&gt; </code></pre> <p>From the page <a href="http://www.360innovate.co.uk/blog/2009/03/periodicalupdater-for-jquery/" rel="nofollow">http://www.360innovate.co.uk/blog/2009/03/periodicalupdater-for-jquery/</a> I downloaded the periodicalupdater plugin for jquery and linked it to my gsp page:</p> <pre><code>&lt;g:javascript src="jquery.periodicalupdater.js"/&gt; </code></pre> <p>On my page I use this script to start the periodicalUpdater:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $.PeriodicalUpdater({ url : 'URL' }, function(data) { var myHtml = 'The data returned from the server was: ' + data + ''; }); }); &lt;/script&gt; </code></pre> <p>The problem is, that the URL isn't even called. I get the following error, when looking at the browser console:</p> <pre><code>'undefined' is not a function (evaluating '$.PeriodicalUpdater') </code></pre> <p>Edit: I solved the problem. The periodicUpdater Plugin was just loaded before the jquery. But now I have another problem. I write the following lines in my code:</p> <pre><code>&lt;g:javascript library="jquery" /&gt;&lt;script type="text/javascript"&gt; $(document).ready(function() { $.PeriodicalUpdater({url : 'http://localhost:8080/PROJECT/comment/ajax_list/1'}, function(data){$('#comment').empty().append(data);}); }); &lt;/script&gt; </code></pre> <p>I want to have the URL without the localhost, because I want to load it in production mode, too...</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.
    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