Forum Moderators: open

Message Too Old, No Replies

javascript and IE7

         

quartzy

2:30 am on Jan 18, 2009 (gmt 0)

10+ Year Member



I have a script that does not work in IE7, is there anything I can add to the code, to get it to work?

<script type="text/javascript" src="http://...../embed.js"></script>
<script type="text/javascript">
obj=new Object;
obj.clockfile="2012olympic001-pink.swf";
obj.TimeZone="UnitedKingdom_London";
obj.width=150;obj.height=225;
obj.Target="2012,7,27,0,0,0";
obj.Title="Title";
obj.Message="Message";
obj.DayU="days";
obj.HourU="hrs";
obj.MinU="min";
obj.SecU="sec";
obj.wmode="transparent";showClock(obj);</script>

(removed the src)
thanks anyone

Fotiman

4:21 am on Jan 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Well, first, you are missing the () after new Object. In other words:
obj = new Object();
However, since this object is probably only used by your showClock method, you could rewrite this like so:

showClock({
clockfile: "2012olympic001-pink.swf",
TimeZone: "UnitedKingdom_London",
width: 150,
height: 225,
Target: "2012,7,27,0,0,0",
Title: "Title",
Message: "Message",
DayU: "days",
HourU: "hrs",
MinU: "min",
SecU: "sec",
wmode: "transparent"
});

In other words, declare the 'object' as an object literal (using { }), and declare it as you pass it in to the showClock method.
Hope that helps.

quartzy

2:16 pm on Jan 18, 2009 (gmt 0)

10+ Year Member



Ok thanks I will try that code, and hope it helps.