473,473 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help mi solve this problem thank you please >_<

1 New Member
i try use this script but keep getting
Char: 6
Error: Expected ';'
What can i do?

Expand|Select|Wrap|Line Numbers
  1. <SCRIPT 
  2. type="text/javascript"> /*Script distributed by Hypergurl.com Visit 
  3. http://www.hypergurl.com/easyhtml.html for this script and many more */ // This 
  4. part preloads images. You can use different images. // Change URL path to the 
  5. snow image below grphcs=new Array(6) Image0=new Image(); Image0.src=grphcs[0]="snow1.gif"; 
  6. Image1=new Image(); Image1.src=grphcs[1]="snow2.gif" Image2=new Image(); 
  7. Image2.src=grphcs[2]="snow3.gif" Image3=new Image(); Image3.src=grphcs[3]="snow4.gif" 
  8. Image4=new Image(); Image4.src=grphcs[4]="snow5.gif" Image5=new Image(); 
  9. Image5.src=grphcs[5]="snow6.gif" // Configure below - change number 
  10. of snow to render Amount=15; Ypos=new Array(); Xpos=new Array(); Speed=new Array(); 
  11. Step=new Array(); Cstep=new Array(); ns=(document.layers)?1:0; ns6=(document.getElementById&&!document.all)?1:0; 
  12. if (ns){ for (i = 0; i < Amount; i++){ var P=Math.floor(Math.random()*grphcs.length); 
  13. rndPic=grphcs[P]; document.write("<LAYER NAME='sn"+i+"' LEFT=0 
  14. TOP=0><img src="+rndPic+"></LAYER>"); } } else{ 
  15. document.write('<div style="position:absolute;top:0px;left:0px"><div 
  16. style="position:relative">'); for (i = 0; i < Amount; i++){ var 
  17. P=Math.floor(Math.random()*grphcs.length); rndPic=grphcs[P]; document.write('<img 
  18. id="si'+i+'" src="'+rndPic+'" style="position:absolute;top:0px;left:0px">'); 
  19. } document.write('</div></div>'); } WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight; 
  20. WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth; for 
  21. (i=0; i < Amount; i++){ Ypos[i] = Math.round(Math.random()*WinHeight); Xpos[i] 
  22. = Math.round(Math.random()*WinWidth); Speed[i]= Math.random()*5+3; Cstep[i]=0; 
  23. Step[i]=Math.random()*0.1+0.05; } function fall(){ var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight; 
  24. var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth; 
  25. var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop; var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft; 
  26. for (i=0; i < Amount; i++){ sy = Speed[i]*Math.sin(90*Math.PI/180); sx = Speed[i]*Math.cos(Cstep[i]); 
  27. Ypos[i]+=sy; Xpos[i]+=sx; if (Ypos[i] > WinHeight){ Ypos[i]=-60; Xpos[i]=Math.round(Math.random()*WinWidth); 
  28. Speed[i]=Math.random()*5+3; } if (ns){ document.layers['sn'+i].left=Xpos[i]; document.layers['sn'+i].top=Ypos[i]+hscrll; 
  29. } else if (ns6){ document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]); 
  30. document.getElementById("si"+i).style.top=Ypos[i]+hscrll; } else{ eval("document.all.si"+i).style.left=Xpos[i]; 
  31. eval("document.all.si"+i).style.top=Ypos[i]+hscrll; } Cstep[i]+=Step[i]; 
  32. } setTimeout('fall()',115); } window.onload=fall //--> </SCRIPT>
Feb 25 '07 #1
3 1361
abctech
157 New Member
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,
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT type="text/javascript"> /*Script distributed by Hypergurl.com Visit http://www.hypergurl.com/easyhtml.html for this script and many more */
  2. // This part preloads images. You can use different images. Change URL path to the snow image below
  3. grphcs=new Array(6);
  4. Image0=new Image();Image0.src=grphcs[0]="snow1.gif"; 
  5. Image1=new Image();Image1.src=grphcs[1]="snow2.gif" ;
  6. Image2=new Image();Image2.src=grphcs[2]="snow3.gif";
  7. Image3=new Image();Image3.src=grphcs[3]="snow4.gif" 
  8. Image4=new Image(); Image4.src=grphcs[4]="snow5.gif" ;
  9. Image5=new Image();Image5.src=grphcs[5]="snow6.gif"; 
Feb 25 '07 #2
r035198x
13,262 MVP
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,
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT type="text/javascript"> /*Script distributed by Hypergurl.com Visit http://www.hypergurl.com/easyhtml.html for this script and many more */
  2. // This part preloads images. You can use different images. Change URL path to the snow image below
  3. grphcs=new Array(6);
  4. Image0=new Image();Image0.src=grphcs[0]="snow1.gif"; 
  5. Image1=new Image();Image1.src=grphcs[1]="snow2.gif" ;
  6. Image2=new Image();Image2.src=grphcs[2]="snow3.gif";
  7. Image3=new Image();Image3.src=grphcs[3]="snow4.gif" 
  8. Image4=new Image(); Image4.src=grphcs[4]="snow5.gif" ;
  9. Image5=new Image();Image5.src=grphcs[5]="snow6.gif"; 
Moved to Javascript forum.
Feb 26 '07 #3
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.
Feb 27 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
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>...
1
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...
4
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...
5
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; ...
0
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...
0
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...
3
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...
0
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...
7
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...
2
by: NannMaw | last post by:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Server Error in '/WebSite1' Application. -------------------------------------------------------------------------------- Invalid postback or callback argument. ...
0
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...
0
marktang
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,...
0
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...
0
Oralloy
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,...
1
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...
0
tracyyun
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...
0
agi2029
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,...
1
isladogs
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...
0
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 ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.