How to avoid conflicts between default and linked jQuery

Kentico Support asked on March 29, 2013 21:10

How to avoid conflicts between default and linked jQuery

Correct Answer

Kentico Support answered on March 29, 2013 21:10

If you want to use another version of the jQuery library other than the default library used by the design mode in Kentico CMS, you would have to link it only on the live site, where the default jQuery library is not linked. You can achieve this by a simple context macro:
Visible property of a web part: { % PortalContext.ViewMode == "LiveSite" % }
Any text (e.g. head section of a master page):
{ %  if (PortalContext.ViewMode=="LiveSite") { return "<script src='jQuery.js' type='text/javascript'>"; }  % }

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.