javascript help with getElementsBy....

Status
Not open for further replies.

Conde James

Seniorius Lurkius
3
Hello all ...

i have some problem with this function when i call getElementsById there is no answer ... like this

Code:
<html>

  <head>

  <body bgcolor="#999999">

    <iframe name="iframe" id="iframe" src="Page2.asp"</iframe>

<script>
var mm = document.getElementById("iframe").contentDocument.forms['emailtoken'];
alert(mm);
</script>
	
</head>
  </body>

</html>

there is an alert undeifined

i don't know how i can do it i have my own project for my university i'll be thank if you solve it for me ...
 

technophile

Ars Legatus Legionis
23,768
You're missing a closing > on the <iframe>'s opening tag; that may be a transcription error, but if not it's going to cause issues.

I would suggest you try to localize the problem -- what's
Code:
document.getElementById('iframe')
return?
Code:
document.getElementById('iframe').contentDocument
?

I suspect jxl is correct and the iframe's content isn't loaded yet.
 
Status
Not open for further replies.
\n\n \n\n