Javascript Problem

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Javascript Problem

Postby davebritton » 23. September 2006 21:21

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
davebritton
 
Posts: 3
Joined: 23. September 2006 21:12
Location: UK

Postby Wiedmann » 23. September 2006 21:28

Is there something I have to setup on XAMPP to run server side javascripts.

What are "server side javascripts"?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Sorry

Postby davebritton » 23. September 2006 22:07

I meant javascripts running on my development/hosting server
davebritton
 
Posts: 3
Joined: 23. September 2006 21:12
Location: UK

Postby Wiedmann » 23. September 2006 23:25

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?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Thanks for your response

Postby davebritton » 24. September 2006 00:28

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 !
davebritton
 
Posts: 3
Joined: 23. September 2006 21:12
Location: UK

Postby Wiedmann » 24. September 2006 01:01

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>

?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 157 guests