嗨,我有一個PHP應用程序,但我的javascript導致的錯誤它完美地運行在本地主機,但是當我上傳到亞馬遜elasticbeanstalk它告訴我這個錯誤Uncaught ReferenceError: getEvent is not defined
這是我的代碼:的Javascript Ajax調用未捕獲引用錯誤
指數一個.phtml
<script type="text/javascript" src="../public/js/page/home.js"></script>
$(document).ready(function(){
getEvent();
});
home.js
function getEvent()
{
var count=1;
$.ajax({
url:baseUrl + "event/popularevent",
data:{'count':count},
dataType:"json",
type:"POST",
async:false,
success:function(data){
var eventHtml = '';
eventHtml = '<li class="clearfix media-block module-li">' +
'<div class="media-avatar-passport">' +
'<div class="photo-box pb-60s">' +
'<a class="event-photo" href="/events/san-francisco-halloween-beer-olympics-halloween-drinking-games-1-beer-free">' +
'<img class="photo-img" alt="Photo of HALLOWEEN BEER OLYMPICS! Halloween Drinking Games + $1 Beer! FREE!" height="60" src="#" width="60"></a></div>' +
'</div><div class="media-story">' +
'<div class="item-title clearfix">' +
'<a href="/events/san-francisco-halloween-beer-olympics-halloween-drinking-games-1-beer-free" class="url summary">HALLOWEEN BEER OLYMPICS! Halloween Drinking Games + $1 Beer! FREE!</a></div>'+
'<div class="item-description">'+
'<span class="extra">'+
' Tomorrow, Oct 26, 8:30 pm'+
'</span><p class="fine-print">140 are interested</p></div>'+
'</div></li>';
//alert('ok');
$('#popular-events .module-list').html(eventHtml);
}
});
}
如果我犯了一個錯誤,它沒有錯誤運行在本地主機不上部署問題謝謝
你檢查的權限爲您的Ajax的網址? – algorhythm
那是怎麼回事?它適用於本地主機.. –