lost in jQuery |
[eluser]zovar[/eluser]
When using jQuery I always have one problem. I assume that it's a common thing. Let's say that my document structure is as follows: Code: <div id="content"> then in my js file I create a function: Quote:$('.toggleContent').click(function(){ so I just replace the content with a new file. Everything works fine on this stage. my requested page looks like this: Code: <a href="/index" class="toggleContent">toggle</a> but my next step is to toggle this back. but jQuery can't locate toggleContent class in a replaced content. So is there a way not load new js file with just a clone function of ajax call, but somehow to refresh DOM?
[eluser]zovar[/eluser]
Sorry, is it possible to move this topic to Code and Application Development category?
[eluser]bobbybaboon[/eluser]
In jquery 1.3 you can add a live event to your click function. Live events documentation If you're using an older version of jquery you can use the jquery livequery plugin Live query plugin The docs should be able to help you out. Otherwise this tutorial at Nettuts.com might be helpful.
|
Welcome Guest, Not a member yet? Register Sign In |