Heyvaert / wiquery

Automatically exported from code.google.com/p/wiquery
0 stars 0 forks source link

jquery $ namespace collition in ajax response #188

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In ajax response $ placeholder for jQuery causes namespace collision.

If added at page load time script generated is

function($){
   $(selector)...
}(jQuery)

but this is not the case in case of ajax response (where it goes directly as 
$(selector)... without wrap). Something similar should be done here as well.

Digging in the source seems like JsQuery.renderHead(IHeaderResponse, 
IRequestTarget) should be calling addAjaxJavascript as 
addAjaxJavascript(requestTarget, 
WiqueryGeneratedJavaScriptResource.wiqueryGeneratedJavascriptCode(js));

Original issue reported on code.google.com by stanisla...@gmail.com on 7 Jun 2011 at 12:56

GoogleCodeExporter commented 9 years ago
I don't see how this is possible, then everyone would have this problem while 
currently you are the only one... in wiquery 1.5 all javascript is placed in a 
ondomready function. 

Using a jQuery object manually means doing thing differently:
If you wish to get this you need to use the JsScope class to generate a 
function statement and add it to the IRequestTarget. 

Original comment by hielke.hoeve on 17 Aug 2011 at 8:41