Author: knopp
Date: Thu Sep 18 17:58:30 2008
New Revision: 696889

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

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=696889&r1=696888&r2=696889&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 Thu 
Sep 18 17:58:30 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