functions with same names in javascript
- by biju
Hi,
I tried to write a function on a js file and another function with the same name in the page.I expected an error but no error came and i got only the function from the js file to execute.How is this possible.Even if i write a function in a separate js file,everything is rendered in a single html file.Then how come it is possible
<script type="text/javascript" language="javascript" src="JScript.js" />
<script language="javascript">
function Boo()
{
alert("Hai new");
}
</script>
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button runat=server OnClientClick="Boo();" Text="Click" />
</div>
</form>
</body>
and in the js file
function Boo() {
alert("Hai");
}