Author: mgrigorov
Date: Mon Jan 24 13:37:02 2011
New Revision: 1062767
URL: http://svn.apache.org/viewvc?rev=1062767&view=rev
Log:
WICKET-3378 Ajax headercontribution does not handle resourcereference id's
Do not set the <script>'s id attribute if the passed argument is null or empty.
Set the type attribute for the newly created <script>
Modified:
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Modified:
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
URL:
http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js?rev=1062767&r1=1062766&r2=1062767&view=diff
==============================================================================
---
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
(original)
+++
wicket/trunk/wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
Mon Jan 24 13:37:02 2011
@@ -1711,8 +1711,11 @@ Wicket.Head.containsElement = function(e
// Wicket.Head.containsElement is aware of that and takes also the underscored
attributes into account.
Wicket.Head.addJavascript = function(content, id, fakeSrc) {
var script = Wicket.Head.createElement("script");
- script.id = id;
+ if (id) {
+ script.id = id;
+ }
script.setAttribute("src_", fakeSrc);
+ script.setAttribute("type", "text/javascript");
// set the javascript as element content
if (null == script.canHaveChildren || script.canHaveChildren) {