Quantcast
Channel: Recent Posts in Pragmatic Guide to JavaScript | Pragmatic Forums
Viewing all articles
Browse latest Browse all 20

Addition to Viewport code posted by F.J. Kraan @ Mon, 07 Feb 2011 09:32:41 +0000

$
0
0

The code for the Viewport example (p.45) displays the link to previous comments visible even after those comments are inserted. This allows the user to insert multiple sets of those comments.
The addition of a ‘onComplete’ function to the new Ajax.Request call seems to solve this problem.


    var upd = new Ajax.Request('known_comments.html', {
      method: 'get',
      onComplete: function() { $('extraComments').hide(); },
      onSuccess: function(res) {
      ...

Viewing all articles
Browse latest Browse all 20

Trending Articles