0

How can i Defer Loading of Jquery.js on all site except one Post Type? Here is site link. I tried to search almost all the forums but found nothing on this topic. It will be really helpful if anybody can help me out.

Horizon_Net
  • 5,959
  • 4
  • 31
  • 34
Rogger
  • 23
  • 4
  • Please [edit] your question to add meaningful code and a problem description here. Don't just link to the site that needs fixing - otherwise, this question will lose any value to future visitors once the problem is solved. Posting a [Minimal, Complete, Verifiable Example](http://stackoverflow.com/help/mcve) that demonstrates your problem would help you get better answers. For more info, see [Something on my web site doesn't work. Can I just paste a link to it?](http://meta.stackexchange.com/questions/125997/) Thanks! – Nathan Tuggy Jun 30 '15 at 01:18
  • I need a code for this query :-p ... Doesn't have any code to write here. This question had never been asked anywhere and might help alot of future visitors... Thanks Nathan – Rogger Jun 30 '15 at 01:20

2 Answers2

0

Have you tried simply using the defer attribute on your markup like so:

 <script src="jquery.js" defer></script>

Or are you looking to dynamically defer the loading of the file? You might want to do something a little like this:

How do I load a javascript file dynamically?

Community
  • 1
  • 1
Deano
  • 2,805
  • 3
  • 29
  • 42
0

Actually, I want to defer jquery.js on all site except one post type. We can somehow possible use the if statement.

Rogger
  • 23
  • 4