Link to home
Start Free TrialLog in
Avatar of andieje
andieje

asked on

do i need to reload jquery and bootstrap js files if i submit a form via ajax?

Hello

Please can you tell me if I need to reload jquery and boostrap js files if I submit a form via ajax?

I was told by one source that I do but reading here it sounds like i dont but rather have to rebind the events

http://jetlogs.org/2009/01/29/re-binding-jquery-events-on-ajax-callbacks/

However my page uses 3rd party code which contains jquery. Being as I didnt write the 3rd party code I wouldn't know what rebinding was required

Please could you explain the process that happens regarding the jquery files and ajax postbacks
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andieje
andieje

ASKER

Thanks for replies. I have read the recommended article but I still am not sure

So existing elements retain all their events associated with them?
If i add new elements and I wnat to capture their events then naturally i will have to bind to them - fair enough.

Is this correct?

Also while i'm thinking about it - though i know this is a separate question - do the stylesheets get aplied to dynamic elements created through ajax? I've not really dont ajax before. I will look this up but being a I'm here it makes sense to get a decent explanation of whats going on :)
So existing elements retain all their events associated with them
Yes - unless you unbind them they keep them.
If i add new elements and I wnat to capture their events then naturally i will have to bind to them
You can either bind them when loaded through ajax or cater for them in your jQuery code to begin with by using the .on example above.

do the stylesheets get aplied to dynamic elements created through ajax
Yes