SharkBait Posted February 19, 2007 Share Posted February 19, 2007 In IE 6.0 I get the following error: Line 180: Object Expected. This is the code for the function: function setImg(rbtn) { // Used to create code on the fly for BackLinks var targBox = document.getElementById('myTextArea'); if(rbtn.value == 1) { targBox.value = "<a href=\"http://mysite.com\" target=\"_blank\"><img src=\"http://mysite.com/allowed/authorizedDistributor.jpg\" /></a>"; } else if (rbtn.value == 2) { targBox.value = "<a href=\"http://mysite.com\" target=\"_blank\"><img src=\"http://mysite.com/allowed/authorizedDistributor2.jpg\" /></a>"; } else if (rbtn.value == 3) { targBox.value = "<a href=\"http://mysite.com\" target=\"_blank\"><img src=\"http://mysite.com/allowed/authorizedDistributor3.jpg\" /></a>"; } } This is how it's done in html: <input type="radio" value="3" onClick="setImg(this);"> <textarea id="myTextArea"></textarea> Am I missing something? Firefox has no issues and it works fine, IE though doesn't like it. Quote Link to comment Share on other sites More sharing options...
fenway Posted February 19, 2007 Share Posted February 19, 2007 Don't know which line 180 is, but my guess is that one of your DOM object doesn't exist yet. Quote Link to comment Share on other sites More sharing options...
SharkBait Posted February 19, 2007 Author Share Posted February 19, 2007 Weird... all my functions are loaded in the <head> </head> section of the website. Quote Link to comment Share on other sites More sharing options...
SharkBait Posted February 19, 2007 Author Share Posted February 19, 2007 Well I went through all my javascript and found some things that were missing.. like semi-colons etc All fixed now. Guess if a function fails due to syntax errors, the ones behind it never get to load. Quote Link to comment Share on other sites More sharing options...
fenway Posted February 20, 2007 Share Posted February 20, 2007 All fixed now. Guess if a function fails due to syntax errors, the ones behind it never get to load. Of course... it gives up along the way. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.