April 29, 2009
Custom JS/CSS For Different Browsers
Posted by: Joy : Category: JavaScript
Code Provided By : !CrazyDavinci!
This will simply enable us to load different JS on IE6, IE7, Firefox, Opera and Safari plus Google Chrome :
-
function x(){
a=navigator.userAgent
if(a.indexOf("Chro")!=-1) return "JS LINK FOR CHROME"
if(a.indexOf("Oper")!=-1) return "JS LINK FOR OPERA"
if(a.indexOf("Fire")!=-1) return "JS LINK FOR FIREFOX"
if(a.indexOf("Safa")!=-1) return "JS LINK FOR SAFARI"
if(a.indexOf("MSIE")!=-1){
msie=a.indexOf("MSIE")
if (parseInt(a.substring(msie+5,a.indexOf(".",msie)))>=7)
return "JS LINK FOR IE7 & ABOVE"
else return "JS LINK FOR IE6 & BELOW"
}
else return "JS LINK FOR OTHER BROWSER"
}
c=document.createElement(‘script’);c.src=x();
document.getElementsByTagName("head")[0].appendChild(c)
Just change the italic part with this for CSS injection :
-
c=document.createElement("link");c.setAttribute("media","screen,print");
c.setAttribute("rel","stylesheet");c.setAttribute("href",x());
document.getElementsByTagName("head")[0].appendChild(c)












June 9th, 2009 at 9:45 am
change nyo yung intruction hirap kac eh
cge na
ganda pa anaman ng lay-out nyo tapos di
namen magamit
sayng
June 10th, 2009 at 3:56 pm
sana may pina iksi nyo na lang ung proseso para mas madali nilang maintindihan ung pag lagay ng layouts…..^^
June 19th, 2009 at 12:56 am
ngagamit q lay-out pero gus2 q aq ggwa srili q..prng movie website ung dating alm nyu pnu un?.. parang ganito..>>http://profiles.friendster.com/user.php?uid=61194366
May 16th, 2010 at 6:26 am
I believe that your statement is rather special as it contains plenty of interesting information. In Any Event, was wondering whether you would want to exchange web links with my website, as I am looking forward to compile more contacts to further expand and gain ground for my web space. I do not mind you pointing my contacts at the sitewide page, just having this web links on this respective page is more than adequate. Anyway, would you please leave a message at my website if you are interested in swapping links, I would really appreciate that. Best wishes from me and hope to hear from you as soon as possible!
October 15th, 2011 at 2:24 am
Online SEO Article……
[...]The information mentioned in the article are some of the best available [...]……