JaoudeStudios.com

Open Source is the road ahead!
It is currently Thu Sep 09, 2010 5:13 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Refreshing the jQuery bits after an Ajax insertion
PostPosted: Fri Mar 27, 2009 12:04 pm 
Offline
1. Newbie

Joined: Mon Jan 19, 2009 5:27 pm
Posts: 2
Say for example you've got a form with a jQuery driven autocomplete function.

If you rebuild the form with Ajax (ie re-insert the tags, this time populated with data, instead of refreshing the overall page), how do you re-initialise the autocomplete javascript??

Cheers for any help. :)


Top
 Profile  
 
 Post subject: Re: Refreshing the jQuery bits after an Ajax insertion
PostPosted: Fri Mar 27, 2009 1:03 pm 
Offline
Site Admin
User avatar

Joined: Wed Jul 02, 2008 7:54 pm
Posts: 596
Location: Surrey
The way I always do it is to use the call back.

When your function loads in the data put the autocomplete function in the call back - so when the data function completes it will run the autocomplete function and rebind all the events - if that makes sense.

Hope that helps ;)

_________________
JaoudeStudios.com :: Eddie Jaoude :: Geek by nature, Linux by choice
Forum JaoudeStudios - php, mysql, xhtml, css, javascript, jquery, svn subversion, linux, lamp, W3C
Online Agile Task board
Open Source is the road ahead!!


Top
 Profile  
 
 Post subject: Re: Refreshing the jQuery bits after an Ajax insertion
PostPosted: Fri Mar 27, 2009 1:19 pm 
Offline
1. Newbie

Joined: Mon Jan 19, 2009 5:27 pm
Posts: 2
jaoudestudios wrote:
The way I always do it is to use the call back.

When your function loads in the data put the autocomplete function in the call back - so when the data function completes it will run the autocomplete function and rebind all the events - if that makes sense.

Hope that helps ;)


what's the "callback"?

Am using tinman's Ajax function to load in the new html, not Jquery's. Don't have time to learn how to use jQuery's ajax stuff.


Top
 Profile  
 
 Post subject: Re: Refreshing the jQuery bits after an Ajax insertion
PostPosted: Fri Mar 27, 2009 1:29 pm 
Offline
Site Admin
User avatar

Joined: Wed Jul 02, 2008 7:54 pm
Posts: 596
Location: Surrey
Bear wrote:
Say for example you've got a form with a jQuery driven autocomplete function.

Oh sorry I assumpted you were using jquery for all of it.

There is probably a callback facility on tinram's ajax too, (callback = runs when complete). In there put the call to the jquery auto complete function.

Tinram will probably be online tonight or over the weekend so might shed some light on it - but doubt he can remember that far back.

_________________
JaoudeStudios.com :: Eddie Jaoude :: Geek by nature, Linux by choice
Forum JaoudeStudios - php, mysql, xhtml, css, javascript, jquery, svn subversion, linux, lamp, W3C
Online Agile Task board
Open Source is the road ahead!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group