Why is my JavaScript function "a" not defined?
- by 4l3x
When I call my JavaScript function B, the javascript console in firefox said that function A is not defined, but on chrome browser if defined. And when I call function "A" in body segment:
<input type="button" onclick="A()" value=" ..A.. ">
, firefox said that function B is not defined? :S
<html>
<head>
<script language="javascript" type="text/javascript">
function B(){
alert(" hi B ");
document.write('<br><br><input type="button" onClick="A()" value=" ..A..">');
};
function A(){
alert(" hi A");
document.write('<br><br><input type="button" onclick="B()" value=" ..b..">');
if (window.WebCL == undefined) {
alert("Unfortunately your system does not support WebCL. ");
return false;
}
}
</script>
</head>
<body>
<input type="button" onclick="B()" value=" ..B.. ">
</body>
</html>