我正在試圖將eric martin的simplemodal實現到我的Codeigniter項目中。到目前爲止,我所能做的就是給我一個在Firebug中找不到的404頁面。我正在使用該模式提醒用戶他們正在從我的網站重定向到第三方網站。我從我的鏈接href中獲取URL以用作模式中的鏈接,以便用戶可以繼續。Codeigniter和eric martin simplemodal
我的想法是,Jquery會抓住/離開/使用適當的控制器並將正確的視圖加載到模態中。它似乎沒有那樣工作。 Firebug將響應顯示爲404.我嘗試向路由文件添加自定義路由以處理許多不同的鏈接可能性,但這沒有任何效果。我應該如何處理這個問題?
jQuery的
var OSX = {
container: null,
init: function() {
$('.depart').click(function (e) {
e.preventDefault();
var myid = $(this).attr('href');
$.get("/depart/" + encodeURIComponent(myid), function(data){
$(data).modal({
opacity: 65,
overlayClose: true,
onOpen: OSX.open
});
});
});
},
open: function (d) {
var self = this;
self.container = d.container[0];
d.overlay.fadeIn('slow', function() {
$("#depart", self.container).show();
d.container.fadeIn('slow', function() {
d.data.fadeIn('slow');
});
});
}
};
OSX.init();
});
鏈接
a class="depart" href="http://www.newwebsite.com"