带有ajax的jquery图像滑块

时间:2011-07-30 12:09:28

标签: php javascript jquery ajax

我正在通过ajax加载外部php页面。外部页面由基于jquery的图像滑块组成。它没有加载。在这里,我通过Ajax调用页面。

<a href="javascript:void(0)" onclick="open_url('3bg.php','loaded');"> Load Jquery </a>

它被加载但该页面内的导航功能不起作用。

这里是ajax导航,名为

var please_wait = null;

function open_url(url, target) {
if ( ! document.getElementById) {
    return false;
}

if (please_wait != null) {
    document.getElementById("target").innerHTML = please_wait;
}

if (window.ActiveXObject) {
    link = new ActiveXObject("Microsoft.XMLHTTP");
} else if (window.XMLHttpRequest) {
    link = new XMLHttpRequest();
}

if (link == undefined) {
    return false;
}
link.onreadystatechange = function() { response(url, target); }
link.open("GET", url, true);
link.send(null);
}

function response(url, target) {
if (link.readyState == 4) {
    document.getElementById(target).innerHTML = (link.status == 200) ?  link.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the fallowing errorcode: " + link.status;
}
}

function set_loading_message(msg) {
please_wait ='<img src="images/ajax-loader.gif"/>';
}

我在哪里进行更正以使其适用于基于Jquery的页面。

1 个答案:

答案 0 :(得分:1)