0
我們正在嘗試創建一個自定義cms,其中當在標記內部放置rel屬性和目標位置時,它會自動附加一個可以從指定位置rel標籤。再次新的內容(通過ajax來)可以有錨標籤與rel屬性。如何在不使用回調的情況下在ajax調用之後執行點擊處理程序
我怎麼能實現它,而無需使用回調
當前代碼
$(document).ready(function(e) {
$("a[rel $= txt]").each(function(index, element) {
$(this).click(function(){
var path = $(this).attr("rel");
path = "./"+path;
var target = $(this).attr("data-target")
$(target).load(path, function(){
$("a[rel $= txt]", this).each(function(){
$(this).click(function(){
var path = $(this).attr("rel");
path = "./"+path;
$("#result").load(path,function(){
$.getScript("js/common.js")
});
})
});
$.getScript("js/common.js");
})
})//click ended
});
})
你有一些示例HTML嗎?而且,你使用的是什麼版本的jQuery? – 2012-02-14 14:33:11
錨點就像 Home 持有者就像
– 2012-02-14 14:41:50