Javascript Setup: What am I doing Wrong?

In summary, the conversation is about someone struggling with web programming and encountering an error about python when trying to run JavaScript. They also mention using Mongoose and Sublime 2. The conversation also includes instructions on how to open a web console and suggestions for troubleshooting the issue. The conversation ends with the person stating they solved the problem by installing Node and adding it as a custom "build system" in Sublime.
  • #1
TheDemx27
Gold Member
169
13
I should be able to figure this out myself, I know.

All it will display is text in html: It won't run any js. I am completely new to any sort of web programming and I've been searching the interwebs for hours. I'm using mongoose as my web server, and sublime 2 as my text editor.

JFKDLSF_zps5f48687f.png


Building returns :
Code:
The system cannot find the file specified
[cmd:  [u'python', u'-u', u'C:\\Users\\Demx\\Desktop\\Programming\\index.html']]
[dir:  C:\Users\Demx\Desktop\Programming]
[path: C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\]
[Finished]

I don't know why it is saying anything about python...
 
Last edited:
Technology news on Phys.org
  • #2
What do you mean by building? JavaScript is interpreted by the web browser.

Also you don't need a server for html and JavaScript. Just open the file in the browser by double clicking on it. In your web browser, you can open up the web console where error messages will be reported.
 
Last edited:
  • #3
Are you sure it is not main.js or phaser.min.js that looks for python?
 
  • #4
Solved it myself, for some reason sublime doesn't check for javascript? I installed node and added it as a custom "build system". Close the thread.
 
  • #5


As a scientist, it is important to approach a problem with a logical and systematic approach. In this case, the first step would be to check for any syntax errors in the JavaScript code and ensure that the code is properly linked to the HTML document. It is also important to make sure that the web server and text editor are configured correctly and that all necessary files are present in the designated directory. Additionally, checking for any errors or warnings in the console can provide valuable information for troubleshooting. If the issue persists, seeking assistance from online resources or seeking guidance from a more experienced programmer may be helpful in resolving the issue. Remember, problem-solving is a crucial skill in any scientific field and it is important to remain patient and persistent in finding a solution.
 

Related to Javascript Setup: What am I doing Wrong?

1. How do I set up Javascript on my computer?

To set up Javascript on your computer, you need to first make sure you have a text editor and a web browser installed. Then, create a new file with a .js extension and write your Javascript code in it. Finally, link the .js file to an HTML file using the <script> tag.

2. Why is my Javascript code not working?

There could be several reasons why your Javascript code is not working. First, check for any syntax errors or typos in your code. Also, make sure the file path to your .js file is correct. Additionally, check if there are any conflicts with other Javascript files or if there are any errors in the console.

3. How do I debug my Javascript code?

To debug your Javascript code, you can use the console in your web browser. You can also use tools like the Chrome DevTools or Firebug to set breakpoints, step through your code, and identify any errors or bugs.

4. Can I use external libraries or frameworks in my Javascript setup?

Yes, you can use external libraries or frameworks in your Javascript setup. You can either download the library and link it to your HTML file or use a CDN link. Just make sure to include the library before your custom Javascript code.

5. Do I need to learn HTML and CSS before learning Javascript?

While having knowledge of HTML and CSS can be helpful in understanding how Javascript interacts with web pages, it is not necessary to learn them before learning Javascript. You can start with the basics of Javascript and then gradually learn HTML and CSS as you progress.

Similar threads

  • Programming and Computer Science
Replies
2
Views
6K
  • Computing and Technology
Replies
1
Views
2K
  • Computing and Technology
Replies
19
Views
9K
Back
Top