T
The Natural Philosopher
Consider:
<script type="text/javascript" language="JavaScript">
function foo()
{
var dung;
dung=document.getElementsByName('foo')[0].value;
Alert(dung);
}
</script>
<INPUT type="hidden" name="foo" value="shite">
<b onclick="foo()">Click here for an opinion on Javascript</b>
Works in everything except IE. IE6/7 seems to regard
document.getElementsByName('foo') as including the function itself and
gives an 'error in page' response. Or perhaps it finds it first, and
that's why the error occurs.
I am sure there s some reason why it works in other browsers but not in
IE, but what is it?
<script type="text/javascript" language="JavaScript">
function foo()
{
var dung;
dung=document.getElementsByName('foo')[0].value;
Alert(dung);
}
</script>
<INPUT type="hidden" name="foo" value="shite">
<b onclick="foo()">Click here for an opinion on Javascript</b>
Works in everything except IE. IE6/7 seems to regard
document.getElementsByName('foo') as including the function itself and
gives an 'error in page' response. Or perhaps it finds it first, and
that's why the error occurs.
I am sure there s some reason why it works in other browsers but not in
IE, but what is it?