You're losing the bound events when you update the html of #nav.
JavaScript in the href's is pretty much frowned at this point in web
development. You can either use event delegation on the UL, or as of
jQuery 1.3 you can use live() (http://docs.jquery.com/Events/
live#typefn); it will bind to all current and future elements on the
page (using event delegation).

On Mar 15, 7:19 pm, "so.phis.ti.kat" <see.marlon....@gmail.com> wrote:
> I simplified my code and remove $("a) code too..
>
> function updateNav(param) {
>         $.ajax({
>                 type: "POST",
>                 cache: false,
>                 url: "assets/ajax/updatenav.php",
>                 data: "opt="+param,
>                 success: function(d){
>                         $("#nav").html(d);
>                 }
>         });
>
> }
>
> and...
>
> <ul id="nav">
>         <li class="disabled">HOME</li>
>         <li class="active"><a href="javascript:updateNav('menu');"
> class="menu">MENU</a></li>
>         <li class="active"><a href="javascript:updateNav('catering');"
> class="catering">CATERING</a></li>
>         <li class="active"><a href="javascript:updateNav('contact');"
> class="contact">CONTACT</a></li>
> </ul>
>
> ... and that worked.  So how can I use jQuery to repeat my ajax call
> (s)?
>
> On Mar 15, 10:04 pm, "so.phis.ti.kat" <see.marlon....@gmail.com>
> wrote:
>
> > Question.
>
> > I have it working right now but i can't get it to work more than
> > once.
> > I am using $.ajax(); and $("a").click(); to initiate this.
>
> > 5 menu buttons, the first one always works, no matter which one, but
> > after it refreshes, the other buttons don't work.
>
> > I am wondering if it is because I am using jQuery to enable my
> > clicks?
>
> > On Mar 13, 1:23 pm, "so.phis.ti.kat" <see.marlon....@gmail.com> wrote:
>
> > > Thanks Guys.
> > > I'll have a look now.
>
> > > On Mar 11, 1:31 pm, Paul Hutson <hutsonphu...@googlemail.com> wrote:
>
> > > > > > Ajax.Updater allows you to simply update the content of a DIV.
>
> > > > If you want to go back to the super simple, you can update the inner
> > > > content of a div with:
>
> > > > $("#DIVID").html("CONTENT");
>
> > > > i.e. :
> > > > <div id="blah"></div>
>
> > > > <script>
> > > > $("#blah").html("I've just been added to the div blah...");
> > > > </script>
>
> > > > Therefore, on your callback from the AJAX - as mkmanning has posted -
> > > > you could do the update using the items that come back from the ajax.
>
> > > > Regards,
> > > > Paul

Reply via email to