Search content within the blog

Wednesday, December 24, 2008

Checking if javascript is disabled in the browser

in your head section of the html page you will have some script written as folows,

<script type="text/javascript">
//just add the below line

function somefunction()

and before closing of the head tag add the following lines
<meta http-equiv="REFRESH" content="0;URL=JavascriptDisabled.aspx"/> </NOSCRIPT>
here JavascriptDisabled.aspx is the page where the user will be redirected if the javascript is disabled

contents for JavascriptDisabled.aspx can be as follows
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JavascriptDisabled.aspx.cs" Inherits="JavascriptDisabled" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" >
<head runat="server">
<title>Loobalee-Javascript Disabled</title>
<body bgcolor="Lightblue">
<form id="form1" runat="server">
<table style="top:750px" align="center" width="50%" border="1">
<td style="color:White">
Javascript is disabled in your browser .Enable javascript and try re-loading the page else <a href="Visitor/Login.aspx">Click Here</a>

No comments:

Post a Comment