Add jquery.js to base page without using a WiQuery component?

1 message Options
Embed this post
Permalink
Tauren Mills

Add jquery.js to base page without using a WiQuery component?

Reply Threaded More More options
Print post
Permalink
My application has a BasePage class that all pages inherit. It contains some interface elements such as a drop-down menu that relies on jQuery.  I am not using any WiQuery elements in the BasePage, but am using them in HomePage which extends BasePage.

I'm using a WiQuery accordion in HomePage, so the jquery.js reference gets added then. It adds the header contributions AFTER all of the headers in BasePage. This means that I cannot access jQuery from my BasePage header to configure the menu.

If I include jQuery in BasePage, then it works. But then any plugins I add to that instance of jQuery appear to be removed when WiQuery's jquery.js contribution is added in HomePage. Besides, I don't want to have two different versions of jquery.js being served to browsers.

Is there a way to add only the WiQuery header contributions in BasePage? I don't want to add any WiQuery components to the page, just the header contributions.  I'm toying around with adding the WiQueryCoreHeaderContributor to my BasePage right now, but haven't been successful yet.  Is this the correct approach?

In fact, that still wouldn't work since they would be added AFTER the headers in the BasePage.html, but I could create a SuperBasePage that adds the WiQuery headers. And then my BasePage would extend SuperBasePage, and the ordering would be right.

Thanks,
Tauren