473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

document.images['imgname'].click()?

This piece of code is working in IE, but not in my Firefox.
The last link should simulate onclick event on the upper image.
Can you suggest me how to make it crossbrowser compatible, please?

....
<a href="http://www.google.com"><img src="img.jpg" id="mypic"
name="mypic"></a><br />
<a href="#something"
onclick="alert(document.images['mypic'].src)">Browser compatibility
check!</a><br />
<a href="#something" onclick="document.images['mypic'].click();">Onclick
event simulation on the upper image!</a>
....

Thanks!
Joe
Jun 2 '06 #1
2 1507
VK
Mad Joe wrote:
This piece of code is working in IE, but not in my Firefox.
The last link should simulate onclick event on the upper image.
Can you suggest me how to make it crossbrowser compatible, please?


Artificial events are not propagated by hierarchy, they are applied
directly to the element they are called for and they stop at this
point.

Also in application to clicks a good part of "common annoyance" and
"interface stealing" protection is based on distinguish between
"physical click" (made by mouse) and "programmed click" (made by
script), so I don't expect it will work as you possibly want even if
you apply it directly to the link itself. You may try though.

Jun 2 '06 #2
You've got the point... I gave up from that!
Thanks anyway!
VK wrote:
Also in application to clicks a good part of "common annoyance" and
"interface stealing" protection is based on distinguish between
"physical click" (made by mouse) and "programmed click" (made by
script), so I don't expect it will work as you possibly want even if
you apply it directly to the link itself. You may try though.

Jun 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Wonko | last post by:
Here's my problem if anyone could be so kind to help me out. I assume it's quite easy for an experienced programmer but I'm not one of them :) I have a JavaScript code that: - displays multiple...
4
by: JimO | last post by:
If the paths to images are hard-coded into an a global array, does that mean that they are pre-loaded? If not, what is the algorithm to do so? Thanks, Jim
0
by: Brad | last post by:
Hi all, I've been using the well document Click Yes program for auto sending emails for some time now and it has done it's job perfectly. In fact I have been so impressed with this that I've...
9
by: Jeff | last post by:
I get the following error when I try to rollover my button: document.images has no properties Line: 22 Am I doing this correctly? Suggestions? This is using Netscape 7.2 on Fedora core 4. ...
3
by: Charles Law | last post by:
Word has a property BuiltinDocumentProperties, which (in VBA) returns a DocumentProperties collection. In VB.NET, using Word automation, it returns a _ComObject. I have tried to cast this to...
7
by: mosipenko | last post by:
I have a website that has articles and images. The articles are stored in one table, and if they have an image associated with them, it's stored in another table with a common id linking them. I...
4
by: JoJo | last post by:
I followed along in Jeremy Keith's book "DOM Scripting" on how to make a image viewer that changes on clicking links. It is up for demo at: http://jojowebdesign.com/dom1.html My question is...
5
by: chazzy69 | last post by:
Quick question does the javascript code below- document.click() Send a mouse click to where the mouse cursor is on the page or does it send it to somewhere else if so where?? Thats it, any...
3
by: jags | last post by:
Hi All I could not display my image through this getElementsById(ImgName).Please let me what is wrong with this piece of code .I have stored all my images in the Doclib of sharepoint site.The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.