Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/413.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在mac上工作,但不在live server(linux)上工作_Javascript_Server - Fatal编程技术网

Javascript在mac上工作,但不在live server(linux)上工作

Javascript在mac上工作,但不在live server(linux)上工作,javascript,server,Javascript,Server,我有个问题。 我的js功能在mac上运行良好,但当我将其上传到服务器上时,它就不起作用了。 这怎么可能? 所有文件都已正确定位 <!doctype html> <html> <head> <meta charset="UTF-8"> <script type="text/javascript" src="js/jquery-1.9.1.js"></script> <script type="text/java

我有个问题。 我的js功能在mac上运行良好,但当我将其上传到服务器上时,它就不起作用了。 这怎么可能? 所有文件都已正确定位

    <!doctype html>
<html>
<head>
<meta charset="UTF-8">

<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript">
 $(function() {

var url="http://www.****.com/***/summer.php";
$.getJSON(url,function(json){
$.each(json.summer,function(i,item){

$('<div class="col-md-4 col-sm-6 col-xs-12 text-center portfolioItemWrapper single-project">' +
'<div class="portfolioItem">' +
'<div class="effect imageWrapper">' + 
'<img src="images/genre/'+item.genre+'.jpg" alt="third">' +
'<div class="caption">' +
'<h4 class="oswald">' + item.name + '</h4>' +
'<p class="serifItalic">' + item.subtitel + ' </p>' + 
'<a href="single-project.html"><span class="moreText"> + </span></a>' +
'</div>' +
'</div>' +
'</div>' +
'</div>'
).appendTo('#betriebe');
});
});
});
  </script>
这里是div,内容只出现在mac上,而不是我从服务器调用它时

<div class="row gallery js-isotope" id="betriebe" data-isotope-options='{ "itemSelector": ".portfolioItemWrapper"}'>


        </div>

提前感谢

http://in-url让我担心您可能无意中遇到跨源限制。您认为我必须更改var-url吗?我试过xxx,但没什么机会…:-检查控制台是否有错误,jquery是否已加载?您应该使用调试器并检查是否获得预期的json数据。@user3690260您需要检查调试器的网络选项卡并查看响应/状态。如果是跨来源请求,则可能会被禁止。