Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/411.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 通过控制台上的jquery刷新xml_Javascript_Jquery_Xml - Fatal编程技术网

Javascript 通过控制台上的jquery刷新xml

Javascript 通过控制台上的jquery刷新xml,javascript,jquery,xml,Javascript,Jquery,Xml,我创建了以下脚本来解析我的xml,然后在键入start后启动某个脚本;在我的控制台中: window.start = function (data) { $.ajax({ type: "GET", url: "test.xml", async: false, dataType: "xml", success: Template }); jQuery('#test').Test({ }

我创建了以下脚本来解析我的xml,然后在键入start后启动某个脚本;在我的控制台中:

window.start = function (data) {
    $.ajax({
        type: "GET",
        url: "test.xml",
        async: false,
        dataType: "xml",
        success: Template
    });

    jQuery('#test').Test({
    });

};
这一部分工作得很好,但我希望它能在每次启动时基本上刷新xml;被称为。目前,它显然没有这样做,因为如果数据是在xml中调整的,则它们不会显示


关于如何做到这一点有什么想法吗?如果这意味着我必须在start中键入test.xml;如何做到这一点,但如果有其他方法,请告诉我。

您可以尝试将async设置为true,或者在默认情况下不声明为true:

async: true,

我自己弄明白了基本上我不刷新我基本上是清空了

因此,我在解析器之前使用

if ($('#test').html()) {
   $('body').empty();
}

虽然这是一个很好的做法,但与老年退休金问题无关。不幸的是,这不起作用。我仍然需要刷新浏览器f5,然后键入start。