Skip to main content

Bug Tracker

Side navigation

#13354 closed bug (notabug)

Opened January 31, 2013 03:45AM UTC

Closed February 12, 2013 03:45AM UTC

a bug about ajax in local file-直接运行本地html文件时js中ajax的BUG

Reported by: huarse@163.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.0
Keywords: Cc:
Blocked by: Blocking:
Description

example:


var json = {};

function init() {

$.ajax({

url : "../config/config.json",

type : "GET",

async : false,

cache : false,

dataType : "json",

success : function(data) {

json = data;

setting();

}

});

}

function setting() {

// some codes that must use the Object "json"

}


以上代码如果放到服务器端运行没有问题,但是如果直接打开本地html文件,就根本不会执行"success: function() {}""里面的内容,导致setting中的内容无法正确执行

在FF和CHROME里面都会出现这样的问题,但是在IE里面却很正常。

Attachments (0)
Change History (1)

Changed February 12, 2013 03:45AM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed

Sorry but I cannot understand the bug report. Since you mentioned Chrome I suspect this is the limitation with local files on Chrome which is something we can't circumvent. You can use a command line switch to fix it though ... I don't have the switch handy.