Running Scripts Locally

I assume I need to install a server to view scripts locally just want to confirm, and maybe a recommendation ? I know of one at the top of my head but forgot :slight_smile:

I’ll second XAMPP – works great, simple to configure, but it gives you a real Apache/php/mySQL setup locally on your normal workstation.

It’s also handy when testing from VM’s when you don’t necessarily want them having direct access to the directories on the host OS.

js runs in the browser.

you don’t need a web server at all to run js.

if you’re talking about php script then I can recommend xampp as a local web server.

…what about JS?

I know, I asked because it doesn’t seem to be working, hrm I’m going to try something else :slight_smile:

Specifying the browser you’re trying to test your scripts in may also provide us with insight otherwise hard to guess as to what the problem really is :slight_smile:

FireFox, I hope that helps !

Well, for FireFox you’ve got:

  1. Tools -> Error Console - for a quick look about problems you may have.
  2. Firebug - you can play around Console or Script in there: run scripts, debug, all sorts.

You must also have Javascript enabled:
Tools -> Options -> Content [tab] -> Enable Javascript [checkbox].

But you need to be so much more specific about a problem, if any :slight_smile:

Error, console error ‘JScript not defined’ but it does work live !

You must also have Javascript enabled:
Tools -> Options -> Content [tab] -> Enable Javascript [checkbox].

It was already enabled.

Well

JScript is a scripting language based on the ECMAScript standard that is used in Microsoft’s Internet Explorer.

So, you probably have the right syntax, e.g. <script type=“text/javascript”> ?

It’s also seems your code is IE specific, like using ActiveX: window.ActiveXObject.

post the code you claim is not working locally but is working live.

I’m not convinced it works live but not locally.

perhaps/its/an/incorrect/path/to/an/external/script.js

/possibly/an/absolute/path.js

rather/than/a/relative/one.js

…/or/the/script/is/in/a/parent/directory.js

or/just/isnt/there/at/all/

Report the locations of all files involved and the <script type=“text/javascript” src=“?”></script> from the HTML document.

<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery.flip.min.js"></script>

Here is the script I have in my head.

So, you probably have the right syntax, e.g. <script type=“text/javascript”> ?

I have this correct :slight_smile:

Are both the .js files in the same folder as the HTML file?

Now I do :slight_smile: It’s working :slight_smile:

Windows can also play havoc with client-side scripts. The Internet configuration (Internet Options, etc.) typically sets locally run scripts as a much higher level of security threat than scripts running on the web. I’ve never understood this, but it’s one of the reasons I usually test my JS through a web server (I program in .NET and use the test server in Visual Web Developer Express). Not sure how you solve your issue, but this can be an unpleasant little problem.