Posts

Showing posts from February, 2017

How to Add Javascript,CSS inside Javascript

<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script> var CSSURL="https://fonts.googleapis.com/css?family=Hind"; $(document).ready(function(){     $("p").click(function(){        alert("Hi");   $.getScript("https://code.jquery.com/ui/1.12.1/jquery-ui.js", function(){    alert("Script loaded but not necessarily executed."); });     }); }); var linkElem = document.createElement('link'); document.getElementsByTagName('head')[0].appendChild(linkElem); linkElem.rel = 'stylesheet'; linkElem.type = 'text/css'; linkElem.href = CSSURL; </script> </head> <body> <p>Click Here to load JS and CSS As well !</p> </body> </html>