The Phantom Posted January 5, 2015 Share Posted January 5, 2015 (edited) How would I re-write this to be more secure? Someone told me this line is now secure. echo'<script>!window.jQuery && document.write(\'<script src="http://code.jquery.com/jquery-1.4.2.min.js"><\/script>\');</script>'; UPDATE - No worries :) Edited January 5, 2015 by The Phantom Quote Link to comment Share on other sites More sharing options...
Djkanna Posted January 6, 2015 Share Posted January 6, 2015 ( for others ) No it's a method of a fallback when loading jQuery. The idea is, load jQuery via some form of CDN ( Google's for example ), then include a variation of the above to load a local copy ( or another CDN if you wish ) in case of failure. <script src="//[insert cdn copy here]"></script> <script>!window.jQuery || document.write ( '<script src="[local copy here]"><\/script>')</script> Most commonly found when using this Relevant snippet Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.