gpt4 book ai didi

javascript - jQuery 重新加载 xml 文档需要关闭浏览器吗?

转载 作者:行者123 更新时间:2023-11-28 00:43:55 24 4
gpt4 key购买 nike

我有一些代码正在使用 jQuery $.ajax 提取 xml 值但是,一旦应用程序在浏览器中运行,对 xml .doc 的任何更改以及随后的浏览器刷新都不会显示新保存的 xml 值 xmlImagePath .

如何在浏览器刷新时强制使用新的 xml 值?

    $.ajax({
type: "GET",
url: "/Images/referal_Image_Config.xml",
dataType: "xml",
success: function (xml) {
//read xml file
$(xml).find('image').each(function () {
if ($(this).attr('active') == 'true') {
var xmlImagePath = $(this).find('pathName').text();

最佳答案

$.ajaxcache 属性设置为 false:

$.ajax({
type: "GET",
url: "/Images/referal_Image_Config.xml",
dataType: "xml",
cache: false,
success: function (xml) {
// your code...
}
});

关于javascript - jQuery 重新加载 xml 文档需要关闭浏览器吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27622270/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com