online editor:potential fix for requests cancelled due to same origin policy

This commit is contained in:
ilvalle
2014-07-22 10:22:48 +02:00
parent 7b2b8155f9
commit 967a37adc4
2 changed files with 6 additions and 16 deletions
+3 -11
View File
@@ -249,14 +249,7 @@ function keepalive(url) {
}
function load_file(url, lineno) {
$.ajax({
type: "GET",
contentType: 'application/json',
cache: false,
dataType: 'json',
url: url,
timeout: 1000,
success: function (json) {
$.getJSON(url, function (json) {
if(typeof (json['plain_html']) !== undefined) {
if($('#' + json['id']).length === 0 || json['force'] === true) {
// Create a tab and put the code in it
@@ -271,11 +264,10 @@ function load_file(url, lineno) {
}
$("a[href='#" + json['id'] + "']").trigger('click', lineno);
}
},
error: function (x) {
}).fail(function() {
on_error();
}
});
return false;
}
function set_font(editor, incr) {