2
Contributors
6
Replies
7
Views
6 Years
Discussion Span
Last Post by ello
0

The code works, but this is the line I'm having trouble with:

die (json_encode('<a href="#" id="xavisys-logo" onClick="myinfo();"></a>'));

You see when the count gets to 5 it does indeed display what it should. The onClick="myinfo(); works as it should, but no matter what I do I can't get it run the AJAX function again when it's been clicked.

Maybe this would help:

$('#xavisys-logo').live('click', function() {
  // Live handler called.
  //do what you want
});

I use live method when there is something reloaded with AJAX, so I guess in your task its the same problem.

You can read more there http://api.jquery.com/live/

0

Maybe this would help:

$('#xavisys-logo').live('click', function() {
  // Live handler called.
  //do what you want
});

I use live method when there is something reloaded with AJAX, so I guess in your task its the same problem.

You can read more there http://api.jquery.com/live/

Thanks alot, worked perfectly. Never heard of this method before so cheers on the info :) +1

ello

0

Good to know that I am able to help somebody, not only get help from others :)

Well you certainly helped me :)

But there is one tiny problem, now the onclick isn't working, don't suppose you or anyone know why this is?

Any help appreciated :)

Edited by ello: n/a

0

I think you can remove onclick and somehow put the code in live click. Its the same as click, only differs that it works when data is refreshed.

0

I think you can remove onclick and somehow put the code in live click. Its the same as click, only differs that it works when data is refreshed.

I was wondering if I had to do that. Cheers for the info :)

ello.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.