From a58285fd06c8113c45377c655dd43cef6337e815 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 11 Jan 2007 19:06:07 +0000 Subject: Aktualisierung auf MediaWiki 1.9.0 --- skins/common/ajax.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'skins/common/ajax.js') diff --git a/skins/common/ajax.js b/skins/common/ajax.js index 6cc652b3..40065593 100644 --- a/skins/common/ajax.js +++ b/skins/common/ajax.js @@ -75,7 +75,7 @@ function sajax_do_call(func_name, args, target) { var i, x, n; var uri; var post_data; - uri = wgServer + "/" + wgScriptPath + "/index.php?action=ajax"; + uri = wgServer + wgScriptPath + "/index.php?action=ajax"; if (sajax_request_type == "GET") { if (uri.indexOf("?") == -1) uri = uri + "?rs=" + encodeURIComponent(func_name); @@ -96,7 +96,14 @@ function sajax_do_call(func_name, args, target) { return false; } - x.open(sajax_request_type, uri, true); + try { + x.open(sajax_request_type, uri, true); + } catch (e) { + if (window.location.hostname == "localhost") { + alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing."); + } + throw e; + } if (sajax_request_type == "POST") { x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1"); x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); -- cgit v1.2.3-54-g00ecf