[jQuery] Re: A very simple newbie problem

2009-09-27 Thread Michael Geary
Your inline onclick handler needs to return false. Maybe your popup() function is returning false, but the onclick handler itself isn't returning anything. You need to do: onclick="popup(href); return false;" If popup() returns false, you can write: onclick="return popup(href);" Or, take a loo

[jQuery] Re: A very simple newbie problem

2009-09-27 Thread Yuzem
Sorry for the delay, it seems that the server was doing some maintenance work. Thanks for the answer. I just find out how to do it the other way: a href="url" onclick="popup(href)" Now, I am getting the href but the problem is that the entire page get reloaded even using return false. Does any

[jQuery] Re: A very simple newbie problem

2009-09-19 Thread Ralph Whitbeck
Then you just need to use the live method to catch the bubbled up DOM elements and attach the click event. See here: $().ready(function(){ $(".popup-link").live("click", function(){ var $popuplink = $(this); $("#popup") .fadeIn("slow")

[jQuery] Re: A very simple newbie problem

2009-09-19 Thread Yuzem
The problem is that the link is dynamically loaded after the original page, the document ready function doesn't affect it. Any idea? -- View this message in context: http://www.nabble.com/A-very-simple-newbie-problem-tp25526787s27240p25527753.html Sent from the jQuery General Discussion maili

[jQuery] Re: A very simple newbie problem

2009-09-19 Thread Ralph Whitbeck
I would structure things a little differently. don't use the onclick event handler. http://jquery.com"; class="popup-link">jQuery Then in your javascript use jQuery: $().ready(function(){ $(".popup-link").click(function(){ var $popuplink = $(this); $("#popup")