I've gotten the onclick event to fire using .click(), but only testing using
an alert("clicked").

I don't mind kludging it this way... what can i put in the onClick of the
<a> tag to make it... click?

   $("#goog").trigger("click");

    http://google.com Link to google 

click() and this.click() don't work...


________
SEAN O



Jonathan Sharp wrote:
> 
> Hey Sean,
> 
> The problem you're experiencing is that you can't trigger (no browser
> support) the default link action via javascript. .click() will trigger the
> "onclick" event but not the default you're expecting.
> 
> Cheers,
> -Jonathan
> 
> 
> On 1/5/07, Sean O <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hey Chris,
>>
>>
>> Tried replacing $(function() { with $(document).ready(function(){, but
>> both
>> have same effect (no clicky).
>> It's that user mouse-clicking (or any other way to simulate the
>> activation
>> of that   tag) that I'm after.
>>
>>
>> ________
>> SEAN O
>>
>>
>>
>> Christopher Jordan-2 wrote:
>> >
>> > Have you tried $(document).ready(function(){
>> >     // put the code to display your image here
>> > });
>> >
>> > Someone correct me if I'm wrong, but .click() is specifically tied to
>> > the user clicking the mouse button.
>> >
>> > I think the document ready code above is the sort of thing you're
>> > looking for.
>> >
>> > Hope this helps!
>> >
>> > Cheers,
>> > Chris
>> >
>> > Sean O wrote:
>> >> Hi,
>> >>
>> >>
>> >> I'm trying to simulate a click of a link on my page. (to open a jpg in
>> >> greybox on page load)
>> >> How do I do it?
>> >>
>> >> I tried click(), but it doesn't seem to do anything.
>> >>
>> >>      $(function() {
>> >>              $("#imglink").css("background","yellow").click();
>> >>      });
>> >>
>> >>       myimg.jpg My
>> >> Image 
>> >>
>> >> The background changes (for testing), but the click event is not
>> >> triggered.
>> >> Tips?
>> >>
>> >>
>> >> Thanks,
>> >>
>> >> ________
>> >> SEAN O
>> >>
>> >
>> > --
>> > http://www.cjordan.info
>> >
>> >
>> > _______________________________________________
>> > jQuery mailing list
>> > discuss@jquery.com
>> > http://jquery.com/discuss/
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Any-way-to-trigger-a-click-by-script--tf2926200.html#a8180780
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>>
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Any-way-to-trigger-a-click-by-script--tf2926200.html#a8185338
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to