Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
jQuery in a SitePublisher site
wexio89
Working on TS 7.3.1, OD 7.3.1, WindowsSever 2008 R2 64bits
Hi TS Devs,
I'd like to know if somebody has been able to add jQuery as a shared resource in the default.site of a SitePublisher site. Everytime we add jQuery as a shared resource and try to render any component in the SitePublisher window or TeamSite web preview we are getting errors. Have anybody tried this before?
Thank you for your help!
Find more posts tagged with
Comments
Rick Poulin
That's because jQuery conflicts with ExtJS. What you can do is include it via header injection in a PreController (or use a component to print out the <script> tag) so that jQuery is not loaded in Edit mode; only in preview and on the runtime. That means your components would render as though JS is disabled in Edit mode, and then you'd see your progressive enhancement upon previewing the page.
wexio89
Hi Rick,
Thank you very much for your answer, but that is exactly what we want executing jQuery while being in the edit mode, we have added some components to our projects that makes heavy use of jQuery and our publishers would like to see how those components work while editing the page, is that something possible?
Rick Poulin
Highly unlikely. You can try initializing jQuery in noConflict mode, but then some or all of your code and plugins might have to be rewritten not to use the $ function.
http://api.jquery.com/jQuery.noConflict/
ExtJS and jQuery are competing frameworks, which both heavily rely on the $ function and on extending default JS types. In other words, it might work today but it'll be a constant worry. I would recommend avoiding this if at all possible.. either rewrite your stuff with ExtJS, or use it only in preview/runtime modes.