I think I solved it. Basically I wrapped everything in a function called js. Then on document load I ran the function. I also re ran the function whenever I reloaded content.
It works, but due to my lack of knowledge on binding, will this affect performance alot? On Aug 11, 2:28 pm, cz231 <cz2...@gmail.com> wrote: > Thanks I think that that is my issue. Is there a way to rebind my > whole javascript file? Or will that affect performance a lot? I ask > because I want pretty much all of my js file pertains to the new > content I'm loading in. > > On Aug 11, 1:17 pm, Shane Riley <shanerileydoti...@gmail.com> wrote: > > > If you're using the latest jQuery, you can bind most events with .live > > () to ensure that your events are attached when the new content is > > loaded in. Note that this doesn't work for all events, though. > > > On Aug 11, 12:03 pm, cz231 <cz2...@gmail.com> wrote: > > > > Hi, > > > > I'm building an online application, and I want one widget to refresh > > > every time a user clicks a certain element. So I wrote a jQuery on > > > click listener that initializes the function to reload the widget. > > > However, when the widget is reloaded, all of the javascript effects > > > stop working for that widget only. It's like I disabled javascript for > > > that part of the page only. Javascript still works everywhere else. > > > > Can any of you jQuery gurus think of a reason why? (preferably one > > > with an easy fix :P)