Page 1 of 1

onload="alert('all')" inside body is not showing any alert l

Posted: Fri Dec 11, 2009 3:33 am
by lokesh_kumar_s
onload="alert('all')" inside body is not showing any alert on load. please tell me what is the problem.

Re: onload="alert('all')" inside body is not showing any alert l

Posted: Fri Dec 11, 2009 11:38 am
by kaszu
You have repeated doctype declaration. Check your html with validator, fix all issues and then it will work.

From sample.zip:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="calendarDateInput.js">
 
/***********************************************
* Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm
* Script featured on and available at http://www.dynamicdrive.com
* Keep this notice intact for use.
***********************************************/
</script>
    <title>Nelgo Solutions Incorporated </title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />   
    <meta name="Robots" content="index,follow" />
    <link rel="stylesheet" type="text/css" href="content.css" />
    <link rel="stylesheet" type="text/css" href="main.css" media="screen" />
    <style type="text/css">
    .style5 {
        text-align: center;
    }
    </style>
 
        <!-- THIS DOCTYPE DECLARATION SHOULDN'T BE HERE -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 

Re: onload="alert('all')" inside body is not showing any alert l

Posted: Mon Dec 14, 2009 7:44 am
by lokesh_kumar_s
Thanks kaszu,

actually i took out that Docttype that you said. but it is still not working do you know any tool that identifies suck error in html.

Re: onload="alert('all')" inside body is not showing any alert l

Posted: Mon Dec 14, 2009 9:30 am
by AbraCadaver
lokesh_kumar_s wrote:Thanks kaszu,

actually i took out that Docttype that you said. but it is still not working do you know any tool that identifies suck error in html.
http://validator.w3.org/

Re: onload="alert('all')" inside body is not showing any alert l

Posted: Mon Dec 14, 2009 9:46 am
by lokesh_kumar_s
AbraCadaver wrote:
lokesh_kumar_s wrote:Thanks kaszu,

actually i took out that Docttype that you said. but it is still not working do you know any tool that identifies suck error in html.
http://validator.w3.org/
actually i took out session_start() which was there in Authentication.php. now it works. but i need to start the session and use session variables. And also i want to execute some function onload of the page .please help.