HOW TO MAKE CROSS BROWSER COMPATIBLE WEBSITES - Eg Net Solution

Here in this sites web and software developer can get some essential information.

MY Favorite .Net Question For Interview

This are not tidy. Just for rough. In Sha Allah will make it tiddy soon. 1.  DateTime2 Date range 0001-01-01 through 9999-12-31  vs Date...

Users Countries


Friday, June 27, 2014

HOW TO MAKE CROSS BROWSER COMPATIBLE WEBSITES


Make your sites cross browser compatible adding  the following java-script code  in your pages head tag :

Make 4 style sheet. for google chrome,1 for fire fox,1 for Internet explorer.
style_google_chrome.css , style_firefox.css , style_IE.css , style.css ,1 for default1 .
<script type="text/javascript">
var browser=navigator.userAgent;
if (browser.lastIndexOf("Chrome")>=5)
{
var callbackFunc = function(){
//alert("WELCOME to Chrome");
};

var head = document.getElementsByTagName( "head" )[0];
var fileref=document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");


fileref.setAttribute("href", "style_google_chrome.css");
fileref.onload = callbackFunc();
head.insertBefore( fileref, head.firstChild );
}
else if(browser.lastIndexOf("Firefox")>=5)
{
var callbackFunc = function(){
//alert("WELCOME to Firefox");
};
var head = document.getElementsByTagName( "head" )[0];
var fileref=document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", "style_firefox.css");
fileref.onload = callbackFunc();
head.insertBefore( fileref, head.firstChild );

}
else if(browser.lastIndexOf("NET")>=5)
{
var callbackFunc = function(){
//alert("WELCOME To Internet explorer");
};
var head = document.getElementsByTagName( "head" )[0];
var fileref=document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", "style_IE.css");
fileref.onload = callbackFunc();
head.insertBefore( fileref, head.firstChild );

}
else
{
var callbackFunc = function(){
//alert("WELCOME others");
};
var head = document.getElementsByTagName( "head" )[0];
var fileref=document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", "style.css");
fileref.onload = callbackFunc();
head.insertBefore( fileref, head.firstChild );

}
</script>

No comments:

Add Choice