This function is used to detect the browser type and to returns a alert ,If the browser is new else returns a alert saying upgrade the browser..
function detectBrowser()
{
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
if ((browser=="Netscape"||browser=="Microsoft Internet Explorer") && (version>=4))
{
alert("Your browser is good enough!");
}
else
{
alert("It's time to upgrade your browser!");
}
}
Please look here
http://www.rit.edu/~gxs8938/rit737/finalindex.html
Friday, February 8, 2008
Javascript 4
This function is used to goto another page when option is selected from drop down menu.
function goToPage2()
{
PageIndex2=document.form2.select2.selectedIndex
if (document.form2.select2.options[PageIndex2].value != "none")
{
window.location = document.form2.select2.options[PageIndex2].value
}
}
Please view here..
http://www.rit.edu/~gxs8938/rit737/finalindex.html
function goToPage2()
{
PageIndex2=document.form2.select2.selectedIndex
if (document.form2.select2.options[PageIndex2].value != "none")
{
window.location = document.form2.select2.options[PageIndex2].value
}
}
Please view here..
http://www.rit.edu/~gxs8938/rit737/finalindex.html
Javascript 3
This function is used to get the window size or browser window size.
function resetWidth()
{
/*
w = document.documentElement.clientWidth;
h = document.documentElement.clientHeight;
*/
w = 1024;
h = 768;
//alert("w: " + w + ", h: " + h);
}
function resizeThisThing()
{
if ((w+h) > 0)
{
top.resizeTo(w, h);
/* alert("Resized to " + w + ", " + h); */
}
}
Please view here..
http://www.rit.edu/~gxs8938/rit737/finalindex.html
function resetWidth()
{
/*
w = document.documentElement.clientWidth;
h = document.documentElement.clientHeight;
*/
w = 1024;
h = 768;
//alert("w: " + w + ", h: " + h);
}
function resizeThisThing()
{
if ((w+h) > 0)
{
top.resizeTo(w, h);
/* alert("Resized to " + w + ", " + h); */
}
}
Please view here..
http://www.rit.edu/~gxs8938/rit737/finalindex.html
Javascript 2
This function is used to create a return message to user after user submits their comments.
function display_confirm()
{
var r=confirm("Press ok button to submit");
if (r==true)
{
document.write("Your comment have been submitted thank you!!");
}
else
{
document.write("You pressed Cancel return back to home!!");
}
}
Please view here..
http://www.rit.edu/~gxs8938/rit737/finalindex.html
function display_confirm()
{
var r=confirm("Press ok button to submit");
if (r==true)
{
document.write("Your comment have been submitted thank you!!");
}
else
{
document.write("You pressed Cancel return back to home!!");
}
}
Please view here..
http://www.rit.edu/~gxs8938/rit737/finalindex.html
Javascript 1
This function is used to create a pop window within the site.window.open() function is used to create a pop up.
function sign()
{
window.open(" guestbook.html"
,"GUESTBOOK","menubar=0,resizable=0,toolbar=0,border=10,scrollbars=0,width=500,height=450,top=200,left=200")
return false;
}
Please click on guestbook link to see how it works..
http://www.rit.edu/~gxs8938/rit737/finalindex.html
function sign()
{
window.open(" guestbook.html"
,"GUESTBOOK","menubar=0,resizable=0,toolbar=0,border=10,scrollbars=0,width=500,height=450,top=200,left=200")
return false;
}
Please click on guestbook link to see how it works..
http://www.rit.edu/~gxs8938/rit737/finalindex.html
Subscribe to:
Posts (Atom)