You probably want to do the opposite, while it's less flexible, is usually
easier to implement.

Instead of adding jQuery from HTML and check collision with tw2.jquery, you
can import jquery_js from tw2.jquery and call jquery_js.inject() inside
your BaseController.__call__ or inside a before_render application global
hook.

That will always ensure that you have jQuery available in your templates
and will let TW aware of the fact that it is already available.


On Thu, Apr 24, 2014 at 2:48 PM, 'Craig Small <[email protected]>' via
TurboGears <[email protected]> wrote:

> On Tue, Apr 22, 2014 at 10:11:22PM +1000, 'Craig Small <[email protected]>'
> via TurboGears wrote:
> > <script src="http://code.jquery.com/jquery.js";></script>
> Now I know what Alessandro was going on about about resource loading and
> what a pain it is.
>
> You don't load jquery, menus don't work.
> You unconditionally load jquery, jqgrid doesn't work.
>
> I had to put this sort of evilness in to get both happy:
> <script>window.jQuery || document.write("<script
> src=\"${tg.url('/javascript/jquery.min.js')}\">\x3C/script>");</script>
>
> It might be a ToscaWidgets bug tripping up jqgrid, not sure.
>
> --
> Craig Small (@smallsees)   http://enc.com.au/       csmall at : enc.com.au
> Debian GNU/Linux           http://www.debian.org/   csmall at : debian.org
> GPG fingerprint:        5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/turbogears.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.

Reply via email to