Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 是否可以在localhost/offline中运行基于ajax的php文件_Javascript_Jquery_Ajax - Fatal编程技术网

Javascript 是否可以在localhost/offline中运行基于ajax的php文件

Javascript 是否可以在localhost/offline中运行基于ajax的php文件,javascript,jquery,ajax,Javascript,Jquery,Ajax,我可以在localhost中运行php应用程序,而不使用ajax/JQuery 如果我使用ajax/JQuery,它将连接到需要有互联网连接的googleapi。我为离线准备了整个应用程序,但如果没有互联网连接,它无法正常工作 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script> 我试过上面的代码

我可以在localhost中运行php应用程序,而不使用ajax/JQuery

如果我使用ajax/JQuery,它将连接到需要有互联网连接的googleapi。我为离线准备了整个应用程序,但如果没有互联网连接,它无法正常工作

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>

我试过上面的代码

<script type="text/javascript" src="ajax/jquery.min.js"></script>

通过从上面显示的url下载jquery.min.js。但它不起作用。 所以最后,, 是否可以脱机/localhost运行基于ajax的php应用程序


请提前告诉我,谢谢…

您使用了cdn中的jQuery。您可以下载jquery文件并将其存储在应用程序目录中,然后将其链接到文件中。然后,您将在应用程序中使用jQuery的功能。当应用程序中使用的所有文件都位于应用程序的目录中时,它不需要具有internet连接。当Jquery可用时,您可以毫无问题地使用ajax或其他功能。

确保您的
Jquery
位于
root
ajax
文件夹中。路径“ajax/Jquery.min.js”很可能是404-只需检查一下即可。如果要避免dns查找超时(脱机加载页面时的延迟),则需要删除对
src=”的请求http://ajax.googleapis.com/...
顺便说一句,它通常写为协议相关url,意思是:
src=//ajax.googleapis.com/…