且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么不嵌入时响应Ajax调用插入的JavaScript执行?

更新时间:2022-05-19 05:34:57

以下code应该工作:

The following code should work:

function onSuccess() {
    src = document.createElement('script');
    src.innerHTML = this.responseText;
    document.body.appendChild(src);
}

不过,我将与cwallenpoole同意,为什么不把所有的JavaScript code(为pretty的-fying日)是已经写在先进的主页? (或脚本包含什么的)。

But I would agree with cwallenpoole that why not have all that javascript code (for pretty-fying the date) be already written in advanced in the main page? (or script included or something).