我试图找出一种方法,只使用我的内联 HTML 作为 ajax GET 方法的 URL,而不是从单独的网页获取数据。这可能吗?
这是我的ajax代码:
$.ajax({
type: "GET",
url: $(elm).attr("href"),
success: function(data){
$("#pageslide-content").html(data)
.queue(function(){
$(this).dequeue();
// restore working order to all anchors
$("#pageslide-slide-wrap a").unbind('click').click(function(elm){
document.location.href = elm.target.href;
});
// add hook for a close button
$(this).find('.pageslide-close').unbind('click').click(function(elm){
_closeSlide(elm);
$(this).find('pageslide-close').unbind('click');
});
settings.complete();
});
}
});
});
任何帮助都会很棒!
更新
SOLVED:
$("#pageslide-content").html('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title></title></head?<body><strong style="color:#C63; font-size:28px; font-weight:bold;">TEST</strong></body></html>')
.queue(function(){
$(this).dequeue();
// restore working order to all anchors
$("#pageslide-slide-wrap a").unbind('click').click(function(elm){
document.location.href = elm.target.href;
});
// add hook for a close button
$(this).find('.pageslide-close').unbind('click').click(function(elm){
_closeSlide(elm);
$(this).find('pageslide-close').unbind('click');
});
settings.complete();
});