Java Script problems

  • 1
  • Question
  • Updated 10 years ago
  • Answered
Every time I try to use Java Script code, it says that there was an error and to check the code. It is right and this happens to me with all java script. Any one know whats going on?
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes

Posted 10 years ago

  • 1
Photo of Monique

Monique, VP of Customer Support

  • 6294 Posts
  • 446 Reply Likes
You would have to tell us what the code is and where you got it from.

I know it doesn't happen with "all javascript" so you will need to be a bit more specific.

While it is possible to add javascript via the HTML editor in SynthaSite we are not in a position to tell you what code will work and what will cause problems with your page.

Maybe if you told us what you were trying to achieve we could suggest a working alternative.
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Thanks, I want to add snow to my webpage for the holidays. If you have a code to do that that will be awesome.
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Oh sorry the script is:
< no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", 10);
}

function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = 0;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", 10);
}

if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
Photo of Ed-a-Torials @ Honey Bear Playhomes

Ed-a-Torials @ Honey Bear Playhomes, Champion

  • 2582 Posts
  • 279 Reply Likes
Hi lambofgod

I have a tutorial that you can use here...

http://honeybearplayhomes.synthasite....

Happy site building
Ed
Photo of lambofgod

lambofgod

  • 875 Posts
  • 35 Reply Likes
Thanks so much Ed.