【发布时间】:2011-02-14 17:36:18
【问题描述】:
加载页面后,我有一个 AJAX 调用来加载一个函数,该函数会打开一个带有一些数据的类似框架的灯箱。问题是,如果我单击关闭(灯箱框架),页面会一次又一次地加载框架,因此使用永远不会到达框架层下的页面,因为框架加载无限循环。 Ajax 正在重复调用我猜想的函数,但我想加载一次框架,当用户单击 X(关闭)时,他可能会返回到原始页面。
$(document).ready(function(){
var city = $('#citycode').html();
$.ajax({
//when page is loaded, fire the following function
success: function(){
//the function to be fired located in the page in seperate file
openX(city + //some other parameters);
}});
});
有什么建议吗?
【问题讨论】: