Author: knopp
Date: Sun Apr 20 17:29:45 2008
New Revision: 650001
URL: http://svn.apache.org/viewvc?rev=650001&view=rev
Log:
try/catch aroud script evaluation
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Modified:
wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=650001&r1=650000&r2=650001&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
(original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js Sun
Apr 20 17:29:45 2008
@@ -197,7 +197,11 @@
var script = tempDiv.childNodes[0].childNodes[0].innerHTML;
element.outerHtml = text;
- eval(script);
+ try {
+ eval(script);
+ } catch (e) {
+ Wicket.Log.error(e);
+ }
return;
}
@@ -290,7 +294,6 @@
Wicket.replaceOuterHtmlSafari = function(element, text) {
// if we are replacing a single <script> element
if (element.tagName == "SCRIPT") {
-
// create temporal div and add script as inner HTML
var tempDiv = document.createElement("div");
tempDiv.innerHTML = text;
@@ -302,10 +305,14 @@
}
element.outerHTML = text;
- eval(script);
+ try {
+ eval(script);
+ } catch (e) {
+ Wicket.Log.error(e);
+ }
return;
}
- var parent = element.parentNode;
+ var parent = element.parentNode;
var next = element.nextSibling;
var index = 0;
@@ -320,9 +327,9 @@
// go through newly added elements and try to find javascripts that
// need to be executed
while (element != next) {
- Wicket.Head.addJavascripts(element);
+ // Wicket.Head.addJavascripts(element);
element = element.nextSibling;
- }
+ }
}
/**