如何使用XAMPP或node.js使AJAX在本地服务器上工作 [英] How to make AJAX work on local server using XAMPP or node.js

查看:142
本文介绍了如何使用XAMPP或node.js使AJAX在本地服务器上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经不知所措了,希望有人能帮忙.

I am at my wit's end and I'm hoping someone can help.

我一直试图让AJAX在本地服务器上运行,但是即使使用最基本的代码,我也不知道从哪里开始.我已经下载了node.js和XAMPP,并且一直在网上寻找有关如何使AJAX测试站点正常工作的教程.

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.

如果有人知道有关如何使最基本的AJAX函数在node.js或XAMPP上运行的分步教程,我将非常感谢.我发现的所有内容似乎都假定阅读者已经知道如何开始使用本地服务器来使代码正常工作.我知道所有示例都需要编写什么代码,我只是不知道如何使它在XAMPP或node.js上运行!谢谢.

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.

推荐答案

XAMPP是否正常工作?您可以通过http://localhost访问它吗?

is XAMPP working? can you access it via http://localhost?

AJAX只是可以发送请求而无需重新加载整个页面的javascript.它不需要任何特殊的工作.

AJAX is just javascript that can send requests without reloading the entire page. it doesn't need anything special to work.

无论本地主机如何工作,重要的是要保持注意,如果需要在url的末尾添加端口以使其正常工作,请注意.

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.

然后将您的html/php文件添加到XAMPP的htdocs文件夹中,并使用本地主机URL导航到它.

then add your html/php file into the htdocs folder of XAMPP and navigate to it using the localhost url.

这篇关于如何使用XAMPP或node.js使AJAX在本地服务器上工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆