April 29, 2009
Custom JS/CSS For Different Browsers
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)







Media-Box
May 3rd, 2009 at 1:59 AM
tolongin dunk,,.,.
May 4th, 2009 at 7:50 AM
boz tlng aqo psangin layout kaya’ gtu dong’z..
please buuuuaaaangggggetttttt…
May 4th, 2009 at 8:05 PM
bang tolong psngin layout yang kren dongggggggg
May 5th, 2009 at 3:21 AM
abang,,,kk,,,,
tolongn q dong…..
q dah nyoba buat layouts js’a tp g berhasil”…….
tolong buatn bisa g??????
May 20th, 2009 at 11:40 AM
hi sa lhat
June 3rd, 2009 at 11:22 PM
saan ipopost ito ?
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 1:26 PM
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!