@JPnycApr 11.2006 — #Click? There is no click event handler. onclick, but not click. However a simple anchor tag shouldn't require an onclick event handler added to it. What else is going on inside the tag?
@David_HarrisonApr 11.2006 — #He doesn't mean onclick="", he means someAnchor.click() as a means to active it, as if the user clicked on it.
That's an IE only piece of code, so you can't use it in anything but IE. If you want to change the page with JavaScript, you could simply look at the href of the link instead, then redirect the user using location.href.
@decibelauthorApr 11.2006 — #nah i dont want to change the page, i need to activate AJAX functionality on page load, depending on the referrer page. Somebody told me there was some way to get firefox to mimic this. Thanks for the help.
@David_HarrisonApr 11.2006 — #If you need to run the functions in the onclick event handler of a link, then why not simply call them rather than using click().
@David_HarrisonApr 11.2006 — #Congratulations, you've proved you can overuse buzzwords. Now how about showing some code and actually explaining why you can't just use a simple function call.
@decibelauthorApr 11.2006 — #i appreciate the help, but can we forget the why, and move on to the how... the site I am working on is being developed in jsp and ajax... the latter of which i am not an expert in.... we need a click() solution for firefox, can anyone give any suggestions that dont compromise our technology?
@David_HarrisonApr 11.2006 — #Maybe if you were [i]more specific[/i]. Here is the way I see it.
You want to activate a link (which you CANNOT do in non-IE browsers). So either you want to change the page or you want to trigger an event handler.
Since you've already said you don't want to change the page, it must be that you want to fire the event handler.
Since event handlers are just used to run pieces of code, mainly function calls, why can't you just call whatever is in the event handler from the JavaScript itself? Surely using .click() is the long way round here.
i need to activate AJAX functionality on page load[/quote]So:<body onload="someFunction();">depending on the referrer page[/quote]And this is where the JSP comes in, you can detect the referer on the server-side, then alter the function call in the onload event handler as desired.
I don't see what the problem is here, so if I've missed something, please spell it out for me. That's why I'm asking for specifics, maybe the situation seems obvious from where you're sitting, but you've given very little away about it so I'm flying blind.
@decibelauthorApr 11.2006 — #its not calling javascript event handlers, its calling java methods... again i just need to know if click() can be simulated in Firefox... its hard to explain how the java beans work
@David_HarrisonApr 11.2006 — #Then I can't help you, because as far as I know, links can only do two things and I don't know anything about Java beans.
I would have thought that since you are using JSP the Java would be on the server-side, but if you're using Java on the client-side too, what is the need for AJAX?
@David_HarrisonApr 11.2006 — #That's to prevent long lines causing horizontal scrolling for the page, they didn't take the code out of vBulliten when they altered the CSS to allow the codebox to scroll. You could get rid of it by adding spaces in after the comma's in the arguement.
Pretty good script, I didn't know that browsers allowed that.