innerHTML在chrome中不起作用

时间:2014-12-10 07:38:25

标签: javascript ajax google-chrome

我正在尝试使用div以下代码替换ajax

document.getElementById("htmlText").value = Txt;

var url = 'VideoPlay.jsp?s=' + Txt;

var req;
if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
    req = new ActiveXObject('Microsoft.XMLHTTP');
}
req.open('get', url, true);
req.onreadystatechange = callback;
req.send(null);

function callback() {
    if (req.readyState == 4 && req.status == 200) {
        var msg = req.responseText;
        alert("before");
        document.getElementById("VideoDiv1").innerHTML = msg;
        alert("after");
        frameccount();
    };
};

function frameccount() {
    var C_Frame = $('#C_Frame').val();
    var VideoName = $('#VideoNames').val();
    var f;
    var flashMovie = getFlashMovieObject("myFlashMovie");

    if (C_Frame != 0) {
        var r = confirm("Do you want to Resume");
        if (r == true) {
            alert(C_Frame);
            f = C_Frame;
            flashMovie.GotoFrame(f);
            flashMovie.Play();
        } else {
            f = 0;
            flashMovie.GotoFrame(f);
            flashMovie.Play();
        }
    } else {
        flashMovie.Play();
    }
}

此代码在firefox中运行正常,但innerHTML在chrome中无法正常工作。在chrome.even中没有错误显示alert("before")alert("after");在chrome中工作意味着{ {1}}。

我哪里错了?如何解决?

0 个答案:

没有答案