Closed GoogleCodeExporter closed 9 years ago
That's pretty straightforward. Just create a function with the following
implementation
function jqry()
{
return jQuery.noConflict();
}
and then replace all "$(<param>)" calls with "jqry()(<param>)" in the jQuery
scripts.
There might be compatibility issues with this solutions I'm not aware of, but
all
jQuery plugins I've incorporated into my apps worked just fine for me using
this
simple hack.
Original comment by google...@pcforum.hu
on 4 Apr 2010 at 1:44
This must be an article to help Prado user make code with jquery. It saves time!
Original comment by long.tru...@nuvixa.com
on 20 May 2011 at 7:31
And with some example is really great!
Original comment by long.tru...@nuvixa.com
on 20 May 2011 at 7:32
Example :
class JavascriptHelper {
public static function publishJQueryCode($page) {
$clientScript = $page->getClientScript();
$endScript=Constants::JQUERY_BEGIN . Constants::CRLF;
$endScript.="$('.selectorExample').jQueryPluginExample();" . Constants::CRLF;
$endScript.=Constants::JQUERY_END;
$clientScript->registerEndScript('JQUERY_CODE',$endScript);
}
}
class Constants {
const CRLF = "\n";
const JQUERY_BEGIN="( function($) {\n";
const JQUERY_END="} ) ( jQuery );\n";
}
Original comment by stbl...@gmail.com
on 20 Sep 2011 at 9:37
Original comment by ctrlal...@gmail.com
on 25 Jun 2012 at 1:56
I just add following row to end of my jquery file:
var $j = jQuery.noConflict();
then I can use $j as jquery on everywhere. All (right coded) jQuery plugins
should work and I have not come across any problems yet with jQuery in Prado.
Original comment by sampsa.s...@inoob.com
on 27 Jul 2012 at 9:52
That should be
jQuery = jQuery.noConflict();
The above wrapper is still needed if the jQuery control class is not defined as
local to a function, otherwise the $() called will be that of prototype's, not
jQuery's, which will prevent most libraries from working.
Original comment by google...@pcforum.hu
on 27 Jul 2012 at 11:07
Original comment by ctrlal...@gmail.com
on 21 Jan 2013 at 7:03
Original comment by ctrlal...@gmail.com
on 24 Jul 2013 at 1:46
Moved to github: https://github.com/pradosoft/prado/issues
Original comment by ctrlal...@gmail.com
on 1 Oct 2013 at 10:14
Original issue reported on code.google.com by
xtree...@gmail.com
on 25 Mar 2010 at 3:08