Odd behavior..

S

SteveA

I just launched this site ( http://www.therionresearch.com ) I've been
working on for the past 2 months and I'm beginning to clean up the
glitches that I hadn't before the site went live. There are two
seperate javascript problems I seem be having, the second of which I
will post later in another topic.

One problem that I cannot seem to figure out deals with a pop-up
window script that I use to display large images. I don't get this
issue on the machine I am working on, but have tested it on 4 other
machines in the office with the same results: if the user clicks on
either the product image or "View larger image" img below BEFORE the
page has COMPLETELY finished loading the popup fails to load and they
are taken to the top of the page (view the # anchor), also if they
clicked before the page loaded the popup will never popup until the
page is refreshed. An example can be seen here (
http://www.therionresearch.com/s1/magnetic-mattress-pad_750.html ),
with the relevant javascript file located here: (
http://www.therionresearch.com/GeneratedItems/prodimg.js ).

I have reduced the size of the prodimg.js file (~5kb) which contains
the function necessary to create the popup but to no avail. I'm really
stumped as to why this is happening. Can anyone help me out?
 
L

Lee

SteveA said:
I just launched this site ( http://www.therionresearch.com ) I've been
working on for the past 2 months and I'm beginning to clean up the
glitches that I hadn't before the site went live. There are two
seperate javascript problems I seem be having, the second of which I
will post later in another topic.

One problem that I cannot seem to figure out deals with a pop-up
window script that I use to display large images. I don't get this
issue on the machine I am working on, but have tested it on 4 other
machines in the office with the same results: if the user clicks on
either the product image or "View larger image" img below BEFORE the
page has COMPLETELY finished loading the popup fails to load and they
are taken to the top of the page (view the # anchor),

The fact that they are taken to the top of the page is probably
the important clue. If you're using a link only for the onclick
handler [then you shouldn't be using a link, at all], then you
should always ensure that the onclick handler returns false, to
prevent the browser from stopping the current page load in order
to follow the link to the top of the page.


--
 
S

SteveA

SteveA said:


I just launched this site (http://www.therionresearch.com) I've been
working on for the past 2 months and I'm beginning to clean up the
glitches that I hadn't before the site went live. There are two
seperate javascript problems I seem be having, the second of which I
will post later in another topic.
One problem that I cannot seem to figure out deals with a pop-up
window script that I use to display large images. I don't get this
issue on the machine I am working on, but have tested it on 4 other
machines in the office with the same results: if the user clicks on
either the product image or "View larger image" img below BEFORE the
page has COMPLETELY finished loading the popup fails to load and they
are taken to the top of the page (view the # anchor),

The fact that they are taken to the top of the page is probably
the important clue. If you're using a link only for the onclick
handler [then you shouldn't be using a link, at all], then you
should always ensure that the onclick handler returns false, to
prevent the browser from stopping the current page load in order
to follow the link to the top of the page.

--

To test your theory I moved the onClick handler to within the <img>
tag on a single page ( http://www.therionresearch.com/s1/breast-pads.html
) and it had no effect. Under normal circumstances the onClick has a
return false to avoid sending the user to the top of the page, but in
the scenario I am describing something seems to be going awry, my best
guess being that the JS file is not loading.

This is a behavior that I cannot replicate on my work machine, so if
you could take a moment to test this to let me know if this is
widespread issue I would appreciate it greatly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top