This can't be done with Ajax.Updater as far as I know, so you would
have to use Ajax.Request and figure out a way to seperate your
content... You could either send the page number in a JSON header
alongside your content or you could send everything as JSON.

// this is how your JSON would look then...
var json = [{ page: 3, content: '<div>bla bla bla</div>' }]


On Oct 31, 9:14 pm, "Brian Williams" <[EMAIL PROTECTED]> wrote:
> one way you could do this is to get the new page number with an
> AJAX.Request before you call theupdater onComplete:
> $("page_num_div_id").innerHTML = 'whatever'
>
> but honestly, why aren't you just putting the page number in the same
> div as the ajax content?  otherwise, if you are grabbing DB content
> this will mean running the query twice.  Once to get the page number,
> once to get the data.
>
> another option, if the number of pages is set i.e. they can't change
> from 5 to 10 rows per page then you could use a js function to just
> increment or decrement the value in the page number div.
>
> On Oct 31, 2007 3:57 PM, richard <[EMAIL PROTECTED]> wrote:
>
>
>
> > hi there
>
> > i want to update more than one elements in the HTML DOM using Ajax.
> > Please look at the following code:
>
> > function forward() {
> >         var url = 'ajax/paginate.php';
> >         var pars = 'direction=forward';
> >         var target = 'content';
> >         var ajax = new Ajax.Updater(target, url, {method: 'get', parameters:
> > pars});
> > }
>
> > Not only 'content' must be updated (this works fine), but also another
> > element ('page-number'). This element must be updated with the new
> > page number witch is also generated by 'ajax/paginate.php'. 'page-
> > number' is somewhere else in the DOM.
>
> > Who can help me?
>
> > << i'm a newbe on prototype >>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to