Hi! I was just wondering how to make a proper .js file. When I usually make one, it just shows the text that I wrote in the browser. How do I fix that?
Offline
On Windows:
1. Go to the Start Menu-->Accessories-->Command line/whatever it's called
2. Type cd Desktop (assuming the file is on your desktop)
3. Type ren myfile.js.txt myfile.js (assuming the file is called myfile.js)
4. Have Fun (or not)
Offline
Offline
What is the exact path of the file (like C:\\Documents and Settings\Users\ImagineIt\Desktop\file.js)?
Offline
I found out I was doing it wrong, but when I run it it just has the code there...
Offline
Alright. Now you need a way to run it. Is this part of HTML, a userscript, what?
Offline
bobbybee wrote:
Alright. Now you need a way to run it. Is this part of HTML, a userscript, what?
Just a js script to test. I'm using notepad++ and when I press launch in chrome it won't work.
Offline
ftf841 wrote:
you cant put it in the desktop put it in the scratch folder so cd program files (X86) cd scratch then type in name of the project.sb
Umm.... What does this have to do with the topic?
Offline
Okay. Make an HTML file (using the same method as for the javascript file). Put it in the same directory of the javascript. Use this contents:
<html> <head> <script type="text/javascript" src="JAVASCRIPT_FILE_NAME.js"></script> </head> <body> </body> </html>
Offline
bobbybee wrote:
Okay. Make an HTML file (using the same method as for the javascript file). Put it in the same directory of the javascript. Use this contents:
Code:
<html> <head> <script type="text/javascript" src="JAVASCRIPT_FILE_NAME.js"></script> </head> <body> </body> </html>
and any body.onload functions
Offline
Save it with a .js extention, or, if it's a userscript, save it with a .user.js extension.
Offline