I am at my wit's end and I'm hoping someone can help.
I have been trying to get AJAX to work on a local server, but I don't know where to begin even with the most basic code. I have downloaded node.js and XAMPP and I have been looking online for tutorials on how to get even AJAX test sites to work.
If anybody knows of a step-by-step tutorial on how to get the most basic AJAX functions to work on node.js or XAMPP I would appreciate it so much. Everything I've found seems to assume the person reading already knows how to begin working with a local server to make the code work. I know what code I need to write from all the examples, I just don't know how to get it to work on XAMPP or node.js! Thank you.
I am at my wit's end and I'm hoping someone can help.
I have been trying to get AJAX to work on a local server, but I don't know where to begin even with the most basic code. I have downloaded node.js and XAMPP and I have been looking online for tutorials on how to get even AJAX test sites to work.
If anybody knows of a step-by-step tutorial on how to get the most basic AJAX functions to work on node.js or XAMPP I would appreciate it so much. Everything I've found seems to assume the person reading already knows how to begin working with a local server to make the code work. I know what code I need to write from all the examples, I just don't know how to get it to work on XAMPP or node.js! Thank you.
Share Improve this question asked Mar 8, 2014 at 19:06 Les PaulLes Paul 1,2785 gold badges22 silver badges47 bronze badges 2- Please don't close, because someone else (stackoverflow./questions/21529208/ajax-with-node-js-server) had a similar problem and some people decided the question was too broad. – Les Paul Commented Mar 8, 2014 at 19:13
-
1
Ajax is just an HTTP request that is send in the background. You set your server up like any other web server, and then, instead of typing the URL in the address bar, you write some JavaScript code to send an
XMLHTTPRequest
: developer.mozilla/en-US/docs/AJAX/Getting_Started. You don't have to do anything specific with the server. – Felix Kling Commented Mar 8, 2014 at 19:15
3 Answers
Reset to default 1is XAMPP working? can you access it via http://localhost
?
AJAX is just javascript that can send requests without reloading the entire page. it doesn't need anything special to work.
however its important that localhost is working and keep note if you need to add a port to the end of the url to get it to work.
then add your html/php file into the htdocs folder of XAMPP and navigate to it using the localhost url.
In case you have Visual Studio installed. Click
- File Menu
- Open
- Web site
- Select the website folder
- Hit F5 to run the app
First, you have to create your html file; do it in the "htdocs" folder of XAMPP, which is likely to have its folder on your C: hard drive path, unless you moved it elsewhere.
Secondly, start XAMPP Apache server. Now you can access your html web page via web browser at "localhost/yourwebpage.html".
Hope this help everyone!