473,770 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
+ 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 1379
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=grph cs[0]="snow1.gif" ;
Image1=new Image(); Image1.src=grph cs[1]="snow2.gif" Image2=new Image();
Image2.src=grph cs[2]="snow3.gif" Image3=new Image(); Image3.src=grph cs[3]="snow4.gif"
Image4=new Image(); Image4.src=grph cs[4]="snow5.gif" Image5=new Image();
Image5.src=grph cs[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.la yers)?1:0; ns6=(document.g etElementById&& !document.all)? 1:0;
if (ns){ for (i = 0; i < Amount; i++){ var P=Math.floor(Ma th.random()*grp hcs.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:0 px;left:0px"><d iv
style="position :relative">'); for (i = 0; i < Amount; i++){ var
P=Math.floor(Ma th.random()*grp hcs.length); rndPic=grphcs[P]; document.write( '<img
id="si'+i+'" src="'+rndPic+' " style="position :absolute;top:0 px;left:0px">') ;
} document.write( '</div></div>'); } WinHeight=(ns|| ns6)?window.inn erHeight:window .document.body. clientHeight;
WinWidth=(ns||n s6)?window.inne rWidth-70:window.docum ent.body.client Width; for
(i=0; i < Amount; i++){ Ypos[i] = Math.round(Math .random()*WinHe ight); Xpos[i]
= Math.round(Math .random()*WinWi dth); Speed[i]= Math.random()*5 +3; Cstep[i]=0;
Step[i]=Math.random()* 0.1+0.05; } function fall(){ var WinHeight=(ns|| ns6)?window.inn erHeight:window .document.body. clientHeight;
var WinWidth=(ns||n s6)?window.inne rWidth-70:window.docum ent.body.client Width;
var hscrll=(ns||ns6 )?window.pageYO ffset:document. body.scrollTop; var wscrll=(ns||ns6 )?window.pageXO ffset:document. body.scrollLeft ;
for (i=0; i < Amount; i++){ sy = Speed[i]*Math.sin(90*Ma th.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(Mat h.random()*WinW idth);
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.getEle mentById("si"+i ).style.left=Ma th.min(WinWidth ,Xpos[i]);
document.getEle mentById("si"+i ).style.top=Ypo s[i]+hscrll; } else{ eval("document. all.si"+i).styl e.left=Xpos[i];
eval("document. all.si"+i).styl e.top=Ypos[i]+hscrll; } Cstep[i]+=Step[i];
} setTimeout('fal l()',115); } window.onload=f all //--> </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
6889
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> tag formatted, for example, bold. However, when it's applied, the number of the <li> is not bold, but the text is. Do I have to apply the bold to the <ol> instead? 2. When I use <li>example text</li>, and when I insert a <br> after the </li>,...
1
3038
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 adjustable) D's : width:100% height:25px can someone please help me with div's and iframes for the picture below ?
4
1639
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 programming well i have been for about 8 years... My brother graduated last year from UCR majoring Computer science and he now works for a buisness programming... well anyways i want to start programming, my brother gave me a c++ book he used but i...
5
4335
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; class CMyBase {
0
1079
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 and is unformatted. I display the text to my user in the listview. The textbox I create logically in the program, and I initialize the correct properties for a normal multiline editor.
0
1019
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 and is unformatted. I display the text to my user in the listview. The textbox I create logically in the program, and I initialize the correct properties for a normal multiline editor.
3
2238
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 namespace std; ...... vector <Vector> vectorlist;
0
1475
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 can help me with this problem, please!!!!!!!!! This is the problem: 3. Several input text files have been provided as input to your program. a) Write a function to combine these files into a single file. b) Write a function to take care of...
7
3627
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 most people use when they write static code (some people use <br>, but with xhtml you are required to close all tags), IE6 simply breaks to the next line like it is supposed to. However, with <br></br>, which is what is sometimes generated by...
2
1858
by: NannMaw | last post by:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Server Error in '/WebSite1' Application. -------------------------------------------------------------------------------- Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from...
0
9617
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10257
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9904
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.