It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

IE8 object expected error

IE8 object expected error

Postby cjgtek on Tue Oct 27, 2009 7:07 pm

I'm trying to write a script that will allow users to change background & text colors for their user profiles. The script works fine in FF and Chrome but generates a Object Expected error in IE8. I've checked everything I can but I don't see a problem.

Code: Select all
<script language="javascript" type="application/javascript">
   function chgBackground(a,b) {
      document.getElementById('adContent').style.backgroundColor = a;
      document.getElementById('adContent').style.color= b;
      }
</script>


here's one of the onClick events. I've tried with and without the 'javascript:' part.

Code: Select all
<td><img src="images/color_1.jpg" alt="" width="17" height="17" onClick="javascript:chgBackground('#4f4f4f','#ffffff');" /></td>



any help is appreciated.

Chris
cjgtek
 
Posts: 2
Joined: Tue Oct 27, 2009 7:03 pm

Re: IE8 object expected error

Postby cjgtek on Tue Oct 27, 2009 7:15 pm

unbelievable. it was the type="application/javascript" in the script tag that was causing the problem!

never mind. crisis averted.
cjgtek
 
Posts: 2
Joined: Tue Oct 27, 2009 7:03 pm


Who is online

Users browsing this forum: Majestic-12 [Bot], Yahoo [Bot] and 4 guests