Author: knopp
Date: Thu Sep 18 17:58:53 2008
New Revision: 696890

URL: http://svn.apache.org/viewvc?rev=696890&view=rev
Log:
WICKET-1623

Modified:
    
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js

Modified: 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL: 
http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=696890&r1=696889&r2=696890&view=diff
==============================================================================
--- 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
 (original)
+++ 
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
 Thu Sep 18 17:58:53 2008
@@ -1430,7 +1430,7 @@
                                        var req = new Wicket.Ajax.Request(src, 
onLoad, false, false);
                                        req.debugContent = false;
                                        if (Wicket.Browser.isKHTML())
-                                               // konqueror can't process the 
ajax response asynchronously, threfore the 
+                                               // konqueror can't process the 
ajax response asynchronously, therefore the 
                                                // javascript loading must be 
also synchronous
                                                req.async = false;
                                        // get the javascript
@@ -1440,8 +1440,18 @@
                                // serialize the element content to string
                                var text = 
Wicket.DOM.serializeNodeChildren(node);
                                
-                               // add javascript to document head
-                               Wicket.Head.addJavascript(text, 
node.getAttribute("id"));
+                               var id = node.getAttribute("id");
+                               
+                               if (typeof(id) == "string" && id.length > 0) {  
                                
+                                       // add javascript to document head
+                                       Wicket.Head.addJavascript(text, id);
+                               } else {
+                                       try {
+                                               eval(text);
+                                       } catch (e) {
+                                               Wicket.Log.error(e);
+                                       }
+                               }
                                
                                // continue to next step
                                notify();


Reply via email to