giammin

Asp.net Load jquery if not available

Nov 13th, 2012
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1.            const string jqueryScript = @"
  2.                             if(typeof jQuery=='undefined') {
  3.                                var jqTag = document.createElement('script');
  4.                                jqTag.type = 'text/javascript';
  5.                                jqTag.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js';    
  6.                                document.body.appendChild(jqTag);} ";
  7.             Page.ClientScript.RegisterStartupScript(GetType(),"jqueryCheck",jqueryScript,true);
Advertisement
Add Comment
Please, Sign In to add comment