This is a discussion on "[SOLVED] Javscript broken in IE 6 (but nothing else, it would seem)..." within the JavaScript Forum section. This forum, and the thread "[SOLVED] Javscript broken in IE 6 (but nothing else, it would seem)... are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Javscript broken in IE 6 (but nothing else, it would seem)...
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] Javscript broken in IE 6 (but nothing else, it would seem)...
So what's new, I hear you cry. In the interests of not looking like an incompetent buffoon in front of the surfers out there who don't know any better than to use IE, could someone please help me out with making my javascript code IE 6 - friendly?
Here is my site: http://www.jonathanmortimer.co.uk/test2 Have a look around, you'll probably soon discover where the problems are (I cannot see them as I don't have IE, but I have been informed that they are mainly on the bottom row of icons). This site works perfectly in Safari and Firefox, although it is not 100% complete yet. Thanks for your help! |
|
|
|
|||
|
Re: Javscript broken in IE 6 (but nothing else, it would seem)...
|
|
|||
|
Re: Javscript broken in IE 6 (but nothing else, it would seem)...
Quote:
|
|
||||
|
Re: Javscript broken in IE 6 (but nothing else, it would seem)...
Yes, IE 6 is certainly struggling with this. You should really make the most of the DOM here.
Instead of using inline event handlers, use a for loop to cycle through your links and apply the onclick event when the DOM is ready. And instead of innerHTML, use appendChild. IE6 has excellent DOM Level 1 support, and using this sort of practice should greatly increase the chances of compatibility.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
|||
|
Re: Javscript broken in IE 6 (but nothing else, it would seem)...
Quote:
The code I have was written by someone else, I'm not even sure how that works. |
|
||||
|
Re: Javscript broken in IE 6 (but nothing else, it would seem)...
I'll try and write up something later. For now I recommend reading up on W3Schools Javascript tutorials.
Even if you're still not sure how to write the script, you'll get to grips with the syntax and methods
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
||||
|
Re: Javscript broken in IE 6 (but nothing else, it would seem)...
OK Jonny, I've got something
I've used a script from Jeremy Keith in his book 'DOM Scripting' (which is a great read for learning Javascript) and modified very slightly (plus commented it too). First, get rid of all the onclick handlers in your markup, and set the href of the link to your target image. Your #thumbs section should look like this;
NOTE: I don't usually do this sort of thing, but since I'm learning it myself it's useful for me to practice whenever possible! Please rename file extension to .js (EDIT: modified 18:39 GMT 30/03/08)
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Last edited by Aso; Mar 30th, 2008 at 17:41. Reason: Changed due to IE6 bug |
|
|||
|
Re: Javscript broken in IE 6 (but nothing else, it would seem)...
Thanks muchly! This does the trick for IE 6 at least, and still works for Firefox and Safari.
One thing though.. it does not change the link tag that surrounds the main image. Reading through the js code, presumably I could add this in by getting the link perhaps from an id contained in the <a> tag for each thumb and set that to be the main image link using the same method that was used to set the image? I'm not sure what everything in the js code does or how it works, it would be a case of best guess, trial and error for me. Wish me luck! |
|
|||
|
Re: Javscript broken in IE 6 (but nothing else, it would seem)...
BY JOVE I'VE DONE IT!!! Hold on, let me check that I wasn't dreaming... *pinch* OW!
With the very much appreciated javascript functions provided by you, of course It now allows a through-click on the main image (but only in the photo and web categories, I used your original js code for the graphics one as I don't want through-clicks there). I just need to create a couple more pages in my large image set and that part of it will be complete.. unless there's a way to detect when the name="" attribute is empty and not set the corresponding attribute, hmm... I'm a bit of a slow learner when it comes to programming I'm afraid, though if I think about it long enough and come back to it later, it will sink in eventually. |
|
||||
|
Re: Javscript broken in IE 6 (but nothing else, it would seem)...
Glad to hear it!
Keep up the learning
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I have literally broken FireFox | Stormraven | Webforumz Cafe | 6 | Jun 10th, 2008 17:45 |
| Photoshop broken! *screams* | CloudedVision | Graphics and 3D | 1 | May 17th, 2008 22:04 |
| Redirect broken links | Oak | Search Engine Optimization (SEO) | 8 | Apr 18th, 2008 21:09 |
| Video's are broken :( | Stormraven | Webforumz Cafe | 5 | Mar 15th, 2008 11:34 |
| Dreamweaver - Broken Links | mark_88_turbo | Graphics and 3D | 5 | Apr 8th, 2005 08:34 |