Skip to content

Instantly share code, notes, and snippets.

@mig1098
Created November 7, 2014 16:10
Show Gist options
  • Save mig1098/d5336a67506e0c6ea102 to your computer and use it in GitHub Desktop.
Save mig1098/d5336a67506e0c6ea102 to your computer and use it in GitHub Desktop.
!function(){var a='<div id="mgcontent">direct bathrooms<br /><a href="www.google.com">linked</a></div>',b=function(){var c={content:$("#mgcontent"),body:$("body"),jquery:!0};return{loadfiles:function(){var a=document.createElement("link");if(a.type="text/css",a.rel="stylesheet",a.id="test1",a.href="//apolomultimedia.us/mg/test1/test1.css",document.getElementsByTagName("head")[0].appendChild(a),"undefined"!=typeof window.jQuery&&"undefined"!=typeof jQuery||c.jquery===!1)console.log("jquery exist");else{var b=document.createElement("script");b.type="text/javascript",b.src="//apolomultimedia.us/mg/test1/jquery.tstmin.js",document.getElementsByTagName("head")[0].appendChild(b),console.log("jquery added")}},changeImg:function(){$("img").attr("src","//apolomultimedia.us/royalty/resources/images.jpg")},addcontent:function(){c.body.prepend(a),$("#mgcontent a").on("click",function(a){a.preventDefault()}),console.log(c)},init:function(){b.loadfiles(),b.changeImg()}}}();b.init()}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment