From 90fffe8a0927f0eefaeb16c2d669f80b7f90e983 Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 11 Feb 2011 19:21:50 +0000 Subject: [PATCH] Fixed locale script to no longer use eval() (and work locally in chrome) git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1995 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/locale/locale.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/editor/locale/locale.js b/editor/locale/locale.js index e480a2ae..9538905e 100644 --- a/editor/locale/locale.js +++ b/editor/locale/locale.js @@ -304,15 +304,15 @@ var svgEditor = (function($, Editor) { var url = conf.langPath + "lang." + lang_param + ".js"; - $.ajax({ - 'url': url, - 'dataType': "script", - error: function(xhr) { - if(xhr.responseText) { - Editor.readLang(eval(xhr.responseText)); - } + $.getScript(url, function(d) { + // Fails locally in Chrome 5+ + if(!d) { + var s = document.createElement('script'); + s.src = url; + document.querySelector('head').appendChild(s); } }); + }; return Editor;