473,385 Members | 1,798 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,385 software developers and data experts.

IE and onclick

Rob
Hello! I have an interesting problem.

On internet explorer only, when I click on any link IE stops downloading all
images.

I have many links which perform javascript operations only. The problem is I
have many images downloading as well. When a user clicks on a link all my
images stop even though the user is not leaving the current page.

Has anyone had this problem? Is there anyway to tell IE to continue
downloading images even though a link has been clicked?

If this is the incorrect group for this question I'd be happy to post
elsewhere; I figure this is the correct place however because if I wasn't
using javascript I wouldn't have this problem ;)

Thanks for any help.

-Robert
Nov 23 '05 #1
4 1380
Rob wrote:
Hello! I have an interesting problem.

On internet explorer only, when I click on any link IE stops
downloading all images.
That is normal. Clicking a link (that is not only a fragment identifier)
is issuing instructions to navigate away from a page so images that
would have been downloaded for that page are no longer needed and it
would be wasteful to download them. Much else that IE would normally do
stops being done at that point as well.
I have many links which perform javascript operations only.
You mean you are using javascript HREFs?
The problem is I have many images downloading as well. When
a user clicks on a link all my images stop even though the
user is not leaving the current page.
That is not what IE thinks is happening. The user does what looks like
navigation to IE and IE treats it as navigation.
Has anyone had this problem?
Hundreds (thousands), but apparently not enough to convince everyone
that there is an issue with IE and javascript pseudo protocol HREFs.
Is there anyway to tell IE to continue
downloading images even though a link has been clicked?
No, but you don't have to use links to execute javascript (styled <input
type="button"> will work), and you don't have to have javascript enabled
IE think the link has been clicked (by using an onclick event handler to
execute the script and returning false from the handler so that the
'click' action is cancelled).
If this is the incorrect group for this question I'd be
happy to post elsewhere; I figure this is the correct place
however because if I wasn't using javascript I wouldn't have
this problem ;)


If you weren't using javascript pseudo-protocol HREFs you wouldn't have
the problem. Hence the standing recommendation that nobody ever use
javascript pseudo-protocol HREFs.

Richard.
Nov 23 '05 #2
Rob
> That is normal. Clicking a link (that is not only a fragment identifier)
is issuing instructions to navigate away from a page so images that
would have been downloaded for that page are no longer needed and it
would be wasteful to download them. Much else that IE would normally do
stops being done at that point as well.
Certainly; I would hope IE would behave that way. I am using
href='javascript:;' though, and that apparantly is making IE think im
leaving the current page, even though im not.
You mean you are using javascript HREFs?
Well, not exactly. I don't want the browser's screen to move when a link is
clicked so I set the href='javascript:;'. Using a href='#' causes the
browser to scroll to the top.
Hundreds (thousands), but apparently not enough to convince everyone
that there is an issue with IE and javascript pseudo protocol HREFs.
Huh, I hadn't heard that it was a bad-practice to use javascript in href's.
I'll have to keep that in mind.
No, but you don't have to use links to execute javascript (styled <input
type="button"> will work), and you don't have to have javascript enabled
IE think the link has been clicked (by using an onclick event handler to
execute the script and returning false from the handler so that the
'click' action is cancelled).
Thats a great idea; thanks for the jolt of common sense :)
If you weren't using javascript pseudo-protocol HREFs you wouldn't have
the problem. Hence the standing recommendation that nobody ever use
javascript pseudo-protocol HREFs.


I've only used them to prevent the browser from scrolling to the top; though
the thought of using styled inputs never occured; I bet that will solve my
problem. Thanks for the advice Richard, it was very helpful.

-Rob
Nov 23 '05 #3
Rob
For anyone who is interested; using styled <input type='button' /> tags
worked perfectly and solved my problem.

-Robert

"Rob" <ro*@rob.com> wrote in message news:dl*********@news3.newsguy.com...
That is normal. Clicking a link (that is not only a fragment identifier)
is issuing instructions to navigate away from a page so images that
would have been downloaded for that page are no longer needed and it
would be wasteful to download them. Much else that IE would normally do
stops being done at that point as well.


Certainly; I would hope IE would behave that way. I am using
href='javascript:;' though, and that apparantly is making IE think im
leaving the current page, even though im not.
You mean you are using javascript HREFs?


Well, not exactly. I don't want the browser's screen to move when a link
is clicked so I set the href='javascript:;'. Using a href='#' causes the
browser to scroll to the top.
Hundreds (thousands), but apparently not enough to convince everyone
that there is an issue with IE and javascript pseudo protocol HREFs.


Huh, I hadn't heard that it was a bad-practice to use javascript in
href's. I'll have to keep that in mind.
No, but you don't have to use links to execute javascript (styled <input
type="button"> will work), and you don't have to have javascript enabled
IE think the link has been clicked (by using an onclick event handler to
execute the script and returning false from the handler so that the
'click' action is cancelled).


Thats a great idea; thanks for the jolt of common sense :)
If you weren't using javascript pseudo-protocol HREFs you wouldn't have
the problem. Hence the standing recommendation that nobody ever use
javascript pseudo-protocol HREFs.


I've only used them to prevent the browser from scrolling to the top;
though the thought of using styled inputs never occured; I bet that will
solve my problem. Thanks for the advice Richard, it was very helpful.

-Rob

Nov 23 '05 #4
Rob wrote:
That is normal. Clicking a link (that is not only a fragment
identifier) is issuing instructions to navigate away from a
page so images that would have been downloaded for that page
are no longer needed and it would be wasteful to download
them. Much else that IE would normally do stops being done at
that point as well.
Certainly; I would hope IE would behave that way. I am using
href='javascript:;' though, and that apparantly is making IE
think im leaving the current page, even though im not.


Yes, that is what happens, and has been happening for many IE versions.
(and there are a small number of other browsers that have had a similar
attitude).
You mean you are using javascript HREFs?


Well, not exactly.


How can you 'not exactly' use a javascript HREF? You either are using
them or you are not, and you are or you would not have experienced the
consequnces.
I don't want the browser's screen to move when a
link is clicked so I set the href='javascript:;'.
Using a href='#' causes the browser to scroll to the top.
The cure is worse than the disease. But on a javascript enabled browser
the activation of any link, internal or external, can be cancelled by
cancelling its click events, so any navigation (including to the start
of the document) can be avoided. And on javascript incapable/disabled
browsers javascript pseudo-protocol HREFs are useless at best.
Hundreds (thousands), but apparently not enough to convince
everyone that there is an issue with IE and javascript pseudo
protocol HREFs.


Huh, I hadn't heard that it was a bad-practice to use javascript in
href's. I'll have to keep that in mind.


As I have said, it has been happening for years but many would rather
believe that the phenomenon is real, even when clearly demonstrated, and
so people still promote the use of javascript pseudo-protocol HREFs.

<snip> I've only used them to prevent the browser from scrolling
to the top;
For which they are not necessary.
though the thought of using styled inputs never occured;
I bet that will solve my problem. Thanks for the advice
Richard, it was very helpful.


Solve this problem, but still leave the problem of creating a system
that is meaningful in the absence of javascript.

Richard.
Nov 23 '05 #5

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

Similar topics

8
by: Shock | last post by:
Hello everyone, I am having a problem with the program below. I have isolated the problem to the onclick event that is located throughout arrQuestions. The onclick event refers to a function...
17
by: Mike Gratee | last post by:
Is it possible to use JavaScript to cause the browser to click a link on a page and have the browser act exactly like the user had clicked on the link directly? In other words, I need to...
2
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display...
3
by: Jamie Jackson | last post by:
I'm rewriting all links' onclick events, but I'm having a problem. The onclick event that I'm inserting works correctly in Opera, but not in FF or IE. I'm retroactively adding the statement...
7
by: extremerep | last post by:
My task is to change the value of a button and then make it functional with the onClick handler. Changing the value to "Play Again" works, but making the onClick work accordingly does not. 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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.