i try use this script but keep getting
Char: 6
Error: Expected ';'
What can i do? - <SCRIPT
-
type="text/javascript"> /*Script distributed by Hypergurl.com Visit
- http://www.hypergurl.com/easyhtml.html for this script and many more */ // This
-
part preloads images. You can use different images. // Change URL path to the
-
snow image below grphcs=new Array(6) Image0=new Image(); Image0.src=grphcs[0]="snow1.gif";
-
Image1=new Image(); Image1.src=grphcs[1]="snow2.gif" Image2=new Image();
-
Image2.src=grphcs[2]="snow3.gif" Image3=new Image(); Image3.src=grphcs[3]="snow4.gif"
-
Image4=new Image(); Image4.src=grphcs[4]="snow5.gif" Image5=new Image();
-
Image5.src=grphcs[5]="snow6.gif" // Configure below - change number
-
of snow to render Amount=15; Ypos=new Array(); Xpos=new Array(); Speed=new Array();
-
Step=new Array(); Cstep=new Array(); ns=(document.layers)?1:0; ns6=(document.getElementById&&!document.all)?1:0;
-
if (ns){ for (i = 0; i < Amount; i++){ var P=Math.floor(Math.random()*grphcs.length);
-
rndPic=grphcs[P]; document.write("<LAYER NAME='sn"+i+"' LEFT=0
-
TOP=0><img src="+rndPic+"></LAYER>"); } } else{
-
document.write('<div style="position:absolute;top:0px;left:0px"><div
-
style="position:relative">'); for (i = 0; i < Amount; i++){ var
-
P=Math.floor(Math.random()*grphcs.length); rndPic=grphcs[P]; document.write('<img
-
id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
-
} document.write('</div></div>'); } WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
-
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth; for
-
(i=0; i < Amount; i++){ Ypos[i] = Math.round(Math.random()*WinHeight); Xpos[i]
-
= Math.round(Math.random()*WinWidth); Speed[i]= Math.random()*5+3; Cstep[i]=0;
-
Step[i]=Math.random()*0.1+0.05; } function fall(){ var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
-
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
-
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop; var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
-
for (i=0; i < Amount; i++){ sy = Speed[i]*Math.sin(90*Math.PI/180); sx = Speed[i]*Math.cos(Cstep[i]);
-
Ypos[i]+=sy; Xpos[i]+=sx; if (Ypos[i] > WinHeight){ Ypos[i]=-60; Xpos[i]=Math.round(Math.random()*WinWidth);
-
Speed[i]=Math.random()*5+3; } if (ns){ document.layers['sn'+i].left=Xpos[i]; document.layers['sn'+i].top=Ypos[i]+hscrll;
-
} else if (ns6){ document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);
-
document.getElementById("si"+i).style.top=Ypos[i]+hscrll; } else{ eval("document.all.si"+i).style.left=Xpos[i];
-
eval("document.all.si"+i).style.top=Ypos[i]+hscrll; } Cstep[i]+=Step[i];
-
} setTimeout('fall()',115); } window.onload=fall //--> </SCRIPT>
3 1361
i try use this script but keep getting
Char: 6
Error: Expected ';'
What can i do?
<SCRIPT
type="text/javascript"> /*Script distributed by Hypergurl.com Visit http://www.hypergurl.com/easyhtml.html for this script and many more */ // This
part preloads images. You can use different images. // Change URL path to the
snow image below grphcs=new Array(6) Image0=new Image(); Image0.src=grphcs[0]="snow1.gif";
Image1=new Image(); Image1.src=grphcs[1]="snow2.gif" Image2=new Image();
Image2.src=grphcs[2]="snow3.gif" Image3=new Image(); Image3.src=grphcs[3]="snow4.gif"
Image4=new Image(); Image4.src=grphcs[4]="snow5.gif" Image5=new Image();
Image5.src=grphcs[5]="snow6.gif" // Configure below - change number
of snow to render Amount=15; Ypos=new Array(); Xpos=new Array(); Speed=new Array();
Step=new Array(); Cstep=new Array(); ns=(document.layers)?1:0; ns6=(document.getElementById&&!document.all)?1:0;
if (ns){ for (i = 0; i < Amount; i++){ var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P]; document.write("<LAYER NAME='sn"+i+"' LEFT=0
TOP=0><img src="+rndPic+"></LAYER>"); } } else{
document.write('<div style="position:absolute;top:0px;left:0px"><div
style="position:relative">'); for (i = 0; i < Amount; i++){ var
P=Math.floor(Math.random()*grphcs.length); rndPic=grphcs[P]; document.write('<img
id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">');
} document.write('</div></div>'); } WinHeight=(ns||ns6)?window.innerHeight:window.docu ment.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth; for
(i=0; i < Amount; i++){ Ypos[i] = Math.round(Math.random()*WinHeight); Xpos[i]
= Math.round(Math.random()*WinWidth); Speed[i]= Math.random()*5+3; Cstep[i]=0;
Step[i]=Math.random()*0.1+0.05; } function fall(){ var WinHeight=(ns||ns6)?window.innerHeight:window.docu ment.body.clientHeight;
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
var hscrll=(ns||ns6)?window.pageYOffset:document.body. scrollTop; var wscrll=(ns||ns6)?window.pageXOffset:document.body. scrollLeft;
for (i=0; i < Amount; i++){ sy = Speed[i]*Math.sin(90*Math.PI/180); sx = Speed[i]*Math.cos(Cstep[i]);
Ypos[i]+=sy; Xpos[i]+=sx; if (Ypos[i] > WinHeight){ Ypos[i]=-60; Xpos[i]=Math.round(Math.random()*WinWidth);
Speed[i]=Math.random()*5+3; } if (ns){ document.layers['sn'+i].left=Xpos[i]; document.layers['sn'+i].top=Ypos[i]+hscrll;
} else if (ns6){ document.getElementById("si"+i).style.left=Math.mi n(WinWidth,Xpos[i]);
document.getElementById("si"+i).style.top=Ypos[i]+hscrll; } else{ eval("document.all.si"+i).style.left=Xpos[i];
eval("document.all.si"+i).style.top=Ypos[i]+hscrll; } Cstep[i]+=Step[i];
} setTimeout('fall()',115); } window.onload=fall //--> </SCRIPT>
Hi,
This code of yours is in Javascript and you have posted in the Java forum. You need to be posting in the JS forum.
Secondly, some of us do use and understand Javascript like myself ( just a little though), but your code is heavily unindented and I think thats the reason you are getting errors in the first place.
Please indent it first, your comments and the actual code lines all seem to be mixed up, can't make out one from the other.
I have indented the first few lines, do the rest the same way, - <SCRIPT type="text/javascript"> /*Script distributed by Hypergurl.com Visit http://www.hypergurl.com/easyhtml.html for this script and many more */
-
// This part preloads images. You can use different images. Change URL path to the snow image below
-
grphcs=new Array(6);
-
Image0=new Image();Image0.src=grphcs[0]="snow1.gif";
-
Image1=new Image();Image1.src=grphcs[1]="snow2.gif" ;
-
Image2=new Image();Image2.src=grphcs[2]="snow3.gif";
-
Image3=new Image();Image3.src=grphcs[3]="snow4.gif"
-
Image4=new Image(); Image4.src=grphcs[4]="snow5.gif" ;
-
Image5=new Image();Image5.src=grphcs[5]="snow6.gif";
Hi,
This code of yours is in Javascript and you have posted in the Java forum. You need to be posting in the JS forum.
Secondly, some of us do use and understand Javascript like myself ( just a little though), but your code is heavily unindented and I think thats the reason you are getting errors in the first place.
Please indent it first, your comments and the actual code lines all seem to be mixed up, can't make out one from the other.
I have indented the first few lines, do the rest the same way, - <SCRIPT type="text/javascript"> /*Script distributed by Hypergurl.com Visit http://www.hypergurl.com/easyhtml.html for this script and many more */
-
// This part preloads images. You can use different images. Change URL path to the snow image below
-
grphcs=new Array(6);
-
Image0=new Image();Image0.src=grphcs[0]="snow1.gif";
-
Image1=new Image();Image1.src=grphcs[1]="snow2.gif" ;
-
Image2=new Image();Image2.src=grphcs[2]="snow3.gif";
-
Image3=new Image();Image3.src=grphcs[3]="snow4.gif"
-
Image4=new Image(); Image4.src=grphcs[4]="snow5.gif" ;
-
Image5=new Image();Image5.src=grphcs[5]="snow6.gif";
Moved to Javascript forum.
acoder 16,027
Recognized Expert Moderator MVP
Your new lines are in the wrong place so the single-line comments are going onto the next line. Obviously JavaScript doesn't recognise these and throws up an error.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Michael |
last post by:
This is a two-part question to which I haven't been able to find an answer
anywhere else.
1. Is it possible to format the bullet/number character of the <li>? In my
styles sheet, I have the <li>...
|
by: Mel |
last post by:
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
A, B, C, D, E are all <iframes>
A's are : width:100% height:60px
B's : width:80px height:100% (or adjustable)
C's : width:100% height:100% (or...
|
by: Weasel |
last post by:
Hey everyone,
My names John and i just recently joined this googl group, and I joined
because i need some help. I'm currently a Sophomore in High school and
i'm really interested in computer...
|
by: Evgeny |
last post by:
Hi, all!
I try to convert my existing code written in VC6 to VC7 and have some
problem with stl auto pointer template.
class CColumn;
#include <memory>
typedef auto_ptr<CMyBase> CMyBasePtr;
...
|
by: Eric |
last post by:
Visual C++ 2005 Express
MVP's and experience programmer's only please!...
I need to get the number of lines in a textbox so I can insert them into a
listview. The text comes from my database...
| |
by: Eric |
last post by:
Visual C++ 2005 Express
MVP's and experience programmer's only please!...
I need to get the number of lines in a textbox so I can insert them into a
listview. The text comes from my database...
|
by: kuiyuli |
last post by:
I'm using VC++ .Net to do a simlple program. I tried to use <vector>
<list> in the program, and I simply put the folowing lines
"
#include <list>
#include <vector>
#include <string>
using...
|
by: nt91rx78 |
last post by:
Our college changes 18 weeks semester to 16 semester, so our CS professor cannot finish teaching the last important chapter which is related with my problw\em.
This is program C problem
Anyone...
|
by: Nathan Sokalski |
last post by:
Something that I recently noticed in IE6 (I don't know whether it is true
for other browsers or versions of IE) is that it renders <br/and <br></br>
differently. With the <br/version, which is what...
|
by: NannMaw |
last post by:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------
Invalid postback or callback argument. ...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |