Log In · Register

 
JavaScript Problem, Please give me some help
luckyvictor
post Apr 5 2008, 02:22 PM
Post #1


Newbie
*

Group: Member
Posts: 3
Joined: Apr 2008
Member No: 637,904



I have a JavaScript as shown below, it is a script to change a phrase in a div for a given time interval. I have tested in on my computer with the code alone, it works definitely. However, when I put it on the Xanga, it just didn't work.

Why?? is there any way to modify it so to make it work on my xanga please?

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<DIV style="MARGIN: 3px 0px 1px 4px" align="center">
<DIV id=oTransContainer
style="FILTER: progidXImageTransform.Microsoft.Wipe(GradientSize=1.0,
wipeStyle=0, motion='forward'); WIDTH: 165px; HEIGHT: 103px">
<div id=oDIV1 style="position:absolute; width:260px; height:115px; z-index:1; left: 50px; top: 77px; filter:Alpha(opacity=10)"; style="visibility: visible">
<font color="#ffffff">AAAAAAAAA</font>
</div>

<div id=oDIV2 style="position:absolute; width:260px; height:115px; z-index:1; left: 50px; top: 77px; filter:Alpha(opacity=10)"; style="visibility: hidden">
<font color="#ffffff">BBBBBBBBBB</font>
</div>
<div id=oDIV3 style="position:absolute; width:260px; height:115px; z-index:1; left: 50px; top: 77px; filter:Alpha(opacity=10)"; style="visibility: hidden">
<font color="#ffffff">CCCCCCCCCC</font>
</div>
<div id=oDIV4 style="position:absolute; width:260px; height:115px; z-index:1; left: 50px; top: 77px; filter:Alpha(opacity=10)"; style="visibility: hidden">
<font color="#ffffff">DDDDDDDDDD</font>
</div>

<script>
var NowFrame = 1;
var MaxFrame = 4;
var bStart = 0;
function fnToggle() {
var next = NowFrame + 1;
if(next == MaxFrame+1)
{
NowFrame = MaxFrame;
next = 1;
}
if(bStart == 0)
{
bStart = 1;

setTimeout('fnToggle()', 6000);
return;
}
else
{
oTransContainer.filters[0].Apply();
document.getElementById('oDIV'+next).style.visibility = "visible";
document.getElementById('oDIV'+NowFrame).style.visibility = "hidden";
oTransContainer.filters[0].Play(duration=2);
if(NowFrame == MaxFrame)
NowFrame = 1;
else
NowFrame++;
} setTimeout('fnToggle()', 6000);
}
fnToggle();
</SCRIPT>
</DIV>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
 
 
Start new topic
Replies
Insurmountable
post Apr 11 2008, 11:19 PM
Post #2


Cornflakes :D
*******

Group: Staff Alumni
Posts: 4,541
Joined: Dec 2005
Member No: 322,923



yes it does, myspace doesn't support javascript.

QUOTE
  • livejournal strips out most of everything (javascript, objects/embeds, iframes), so only images are allowed. msn spaces is pretty much the same way.
  • xanga allows javascript in parts of your layout, so the regular version of the code works.
  • myspace has strange filters. scripts are stripped out. images are allowed, unless they don't end in .gif, .png or .jpg (so my original image script broke because the url looked like /adopt/petimage.php?param=value. i had to change it to /adopt/petimage/encoded-params.png…). objects are not allowed. embeds are allowed, but only if the filename ends in .swf (i think some other extensions are allowed too, i haven't tested)… but embeds are turned into iframes! plus all the embed parameters are stripped out. iframes are allowed, but only for certain filename extensions (like embed).
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: