Search code examples
javascriptjqueryqtip

Can I exclude a javascript file from being used on a page?


I am using jQuery Qtip 1 and Qtip 2 plugin scripts. I have to have them both linked on my homepage, but of course it gives errors because I am linking to both of them on the Homepage. Is there a way to exclude Qtip 1 from JUST one page, or simply tell the page to only use this particular javascript instead of the other; perhaps I have to use jQuery?

Also, 80% of my pages are using Qtip 1, and only the homepage is using Qtip 2.

I am using Template pages.


Solution

  • You can add a class name to the <body> element in each page, then write if ($('body').hasClass('something')).