I am having a curious problem with a javascript function and the best way I know how to describe this problem is with an example. This script has only been designed for the use of IE browsers only, so other browsers will not work at all, sorry.
Problem javascript code:
If I remove the last line, the onchange() event, the code works fine everytime, so I am guessing this is the problem area? This is indeed a unique problem, because it does not cause a problem on all calls to this function, only when certain areas are calling it?
What in the world am I talking about, lol, well I did say an example was the best way to explain this one:
If you goto my link at the end of my query here, you should find that an image map page should load. Once loaded if you move your mouse over the USA and click, another image map, of the USA, should load, now don't get ahead of me here, please.
Now, if you select the Unknown selection from the Country selection box, you should return the original entry point. If you now select the Country of USA, instead of moving your mouse over that area, again the image map of the USA should load.
So far this has proved that both the mouseover of the country and the selection of the country from the selection box do the same thing, right?
Ok, from this point on is where the problem happens at, if you select the state of Alabama from either the selection box or by moving your mouse over it, the appropriate image should load.
If you select the state of Washington from the selection box, that state loads great,
[CAUTION HERE: Your IE browser will shut down on the next step!]
however if you move your mouse over this state and click we get a big ole error message and IE shuts down??????? You can see that when you move your mouse over this location that the above function is called in your browser's status bar. This one is driving me nuts, 1: because the map loads fine when selected from the selection box. The above function does nothing more than change the value of this selection box to the state of Washington and then trigger the onChange event, so the same functions are being called. Why it works one way and not the other?
Like I said, the last option I mentioned above will shut down your browser, so be prepared.
If can handle restarting your browser more than once, you will find that other states load like the state of Alabama and other states also load like the state of Washington, I only use these two as examples to get my problem across.
Hopefully someone can help me understand why this is happening?
Thanks for your time,
Mark
PS: The link:
Problem javascript code:
Code:
function changeRegion(regionNumber) {
document.Search.Region.selectedIndex = parseInt(regionNumber);
document.Search.Region.onchange();
}
If I remove the last line, the onchange() event, the code works fine everytime, so I am guessing this is the problem area? This is indeed a unique problem, because it does not cause a problem on all calls to this function, only when certain areas are calling it?
What in the world am I talking about, lol, well I did say an example was the best way to explain this one:
If you goto my link at the end of my query here, you should find that an image map page should load. Once loaded if you move your mouse over the USA and click, another image map, of the USA, should load, now don't get ahead of me here, please.
Now, if you select the Unknown selection from the Country selection box, you should return the original entry point. If you now select the Country of USA, instead of moving your mouse over that area, again the image map of the USA should load.
So far this has proved that both the mouseover of the country and the selection of the country from the selection box do the same thing, right?
Ok, from this point on is where the problem happens at, if you select the state of Alabama from either the selection box or by moving your mouse over it, the appropriate image should load.
If you select the state of Washington from the selection box, that state loads great,
[CAUTION HERE: Your IE browser will shut down on the next step!]
however if you move your mouse over this state and click we get a big ole error message and IE shuts down??????? You can see that when you move your mouse over this location that the above function is called in your browser's status bar. This one is driving me nuts, 1: because the map loads fine when selected from the selection box. The above function does nothing more than change the value of this selection box to the state of Washington and then trigger the onChange event, so the same functions are being called. Why it works one way and not the other?
Like I said, the last option I mentioned above will shut down your browser, so be prepared.
If can handle restarting your browser more than once, you will find that other states load like the state of Alabama and other states also load like the state of Washington, I only use these two as examples to get my problem across.
Hopefully someone can help me understand why this is happening?
Thanks for your time,
Mark
PS: The link: