Page 1 of 1

Javascript Problem

PostPosted: 23. September 2006 21:21
by davebritton
I have installed XAMPP and everything is running fine, MYSQL and I have published the page I am developing in HTDOCS. I have written some function s in javascript written to a file functions.js when my PHP Calls these functions it attempts to open the file javascript.js rather than run the functions. Is there something I have to setup on XAMPP to run server side javascripts. Any help would be appreciated or any links to info on setting this up

To ensure it is not just my code that does not work I have copied other example .js files and they attempt to load rather than run too.

Many Thanks

Dave

PostPosted: 23. September 2006 21:28
by Wiedmann
Is there something I have to setup on XAMPP to run server side javascripts.

What are "server side javascripts"?

Sorry

PostPosted: 23. September 2006 22:07
by davebritton
I meant javascripts running on my development/hosting server

PostPosted: 23. September 2006 23:25
by Wiedmann
Javascript is a client side scripting language and not a server side scripting language.

Maybe i missunderstand something? Can you explain more detailed what are you doing?

Thanks for your response

PostPosted: 24. September 2006 00:28
by davebritton
I am developing a web site. I have php, html and javascript files saved in xampp, htdocs. The PHP and HTML work fine. When the javascript function functions.js are called from php or html a popup message appears asking if I want to save or open the file functions.js

I hope this helps !

PostPosted: 24. September 2006 01:01
by Wiedmann
When the javascript function functions.js are called from php ...

You can't call JS functions from PHP (PHP is on server side, and JS is on client side) ...

When the javascript function functions.js are called from ... html

Now you are talking about external JS script files, which you are include in your HTML with something like
Code: Select all
<script src="foo.js" type="text/javascript"></script>

?