Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

[12:50:43 CDT(-0500)] <EricDalquist> so uPortal and all portlet's use jQuery in noconflict mode

[12:50:59 CDT(-0500)] <EricDalquist> https://wiki.jasig.org/display/PLT/JavaScript+Best+Practices

[12:51:08 CDT(-0500)] <EricDalquist> uPortal's jQuery instance lives at "up.jQuery"

[12:51:38 CDT(-0500)] <EricDalquist> what you should do is wrap javascript that needs a reference to jQuery with:

[12:51:42 CDT(-0500)] <EricDalquist> (function($) {

[12:51:46 CDT(-0500)] <EricDalquist> JSHERE

[12:51:54 CDT(-0500)] <EricDalquist> })(up.jQuery);

[12:52:03 CDT(-0500)] <EricDalquist> that makes the $ var available but only in the closure

[12:52:06 CDT(-0500)] <EricDalquist> instead of globally

[12:52:10 CDT(-0500)] <obbo> ah, ok. thanks

[12:52:10 CDT(-0500)] <EricDalquist> which could break other things on the page

[12:52:24 CDT(-0500)] <EricDalquist> note that WPP has the ability to do pre/post static htmlk

[12:52:27 CDT(-0500)] <EricDalquist> so you could add that

[12:52:38 CDT(-0500)] <EricDalquist> and pull in a specific version of jquery there

[12:52:50 CDT(-0500)] <EricDalquist> grab it into a no-conflict reference

[12:53:30 CDT(-0500)] <EricDalquist> then in the post html you could do that closure to make the $ available

[12:54:58 CDT(-0500)] <obbo> yeah, that sounds like a better idea. the js uses 1.7+ apis a lot. i'll look into that. thanks for all your help

[12:55:09 CDT(-0500)] <EricDalquist> yup

[12:55:14 CDT(-0500)] <EricDalquist> good luck (smile)