|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Null or Not an Object in IE
OK have the following function in my code:
Code:
function newhslide() {
if (h == hnumslides) h = 0;
h++;
document.images['hslide'].src = hpiclist[h];
document.links['hsurl'].href = hpicurl[h];
}
Code:
<a href="javascript:void(0);" id="hsurl"> <img alt="header slide" name="hslide" src="images/cartpics/hometop.jpg" height="366" width="700" border="0"> </a> Code:
document.links['hsurl'].href = hpicurl[h]; 'document.links.hsurl' is null or not an object I know I'm missing something simple here, but as usual with IE not sure what it is. Any help please? Last edited by java49768; 11-04-2009 at 10:42 AM. Reason: Explain a bit further |
|
#2
|
||||
|
||||
|
id and name are different things.
The classical old syntax Code:
document.links['hsurl'] |
|
#3
|
|||
|
|||
|
Thanks for the replay, but
Code:
<a href="javascript:void(0);" name="hsurl"> |
|
#5
|
|||
|
|||
|
Unbelievable! Man I hate IE. The way I had it with name was fine provided I didn't use the brackets [ ]. I changed it to parentheses () and it worked in IE. But now Firefox didn't like it. I had tried jasonahoule's suggestion before as one of my tests but I used the [] and of course IE didn't like that. Now using the () instead, it of course worked perfectly in both IE and Firefox. Did I mention I hate IE?
Thanks so much, this has been such a frustrating modification when it only took a few minutes to write in the first place and worked in the only Browser that I'll ever use. Too bad I can't convince everyone else to stop using IE... lol. Thanks again guys! |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|