Author: jcompagner
Date: Tue Jan 22 08:08:28 2008
New Revision: 614229
URL: http://svn.apache.org/viewvc?rev=614229&view=rev
Log:
extra try catch and try again for creating style sheets
sometimes IE throws an exception calling createStyleSheet() and then the
complete processing is halted.
Modified:
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Modified:
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL:
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=614229&r1=614228&r2=614229&view=diff
==============================================================================
---
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
(original)
+++
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Tue Jan 22 08:08:28 2008
@@ -1347,8 +1347,25 @@
style.id = node.getAttribute("id");
// create stylesheet
- if (Wicket.Browser.isIE()) {
- document.createStyleSheet().cssText = content;
+ if (Wicket.Browser.isIE()) {
+ try
+ {
+ document.createStyleSheet().cssText =
content;
+ }
+ catch(ignore)
+ {
+ var run = function() {
+ try
+ {
+
document.createStyleSheet().cssText = content;
+ }
+ catch(e)
+ {
+ Wicket.Log.error(e);
+ }
+ }
+ window.setTimeout(run, 1);
+ }
} else {
var textNode = document.createTextNode(content);
style.appendChild(textNode);