tags:

views:

112

answers:

3

where is error?

<iframe  src="jquerytabs/index.html" name="bulten"  scrolling="auto"  id="ifr2" frameborder="0" style="width:100%;" marginheight="0" marginwidth="7"  height="288" ></iframe>


<script type="text/javascript"> 
document.write(parent.document.getElementById('ifr2').src) --->error is here but how can I correct?
</script>   
+2  A: 

The error means that parent.document.getElementById('ifr2') is returning null. Why are you using parent.document instead of just document?

Does your script really come after the <iframe>, as it does in the code you posted? Is it possible that you have more than one element with the same "id" value ("ifr2") (probably not, but it's worth checking)?

Pointy
iframe isn'n loading but iframe is loading when I do refresh in IE
I don't understand what you mean, @stack5. The error you're getting doesn't have much to do with whether the `<iframe>` content loads.
Pointy
now iframe is loadig with -document.write(parent.document.getElementById('ifr2').src)- but I have object required error
You should post more of your code, and take the time to provide a complete description of what happens when your page loads and what the problems/errors are.
Pointy
A: 

Are you trying to read the iframe URL or the HTML of the content inside the iframe? Your posted code seems to indicate the former, if the parent. part is removed:

<script type="text/javascript"> 
  document.write(document.getElementById('ifr2').src);
</script>
Gert G
error was correct but Linlk see (http://domainname/anasayfa/jquerytabs/index.html) how can I hide
The links leads to nowhere. What is it that you want to hide? The iFrame?
Gert G
background color=whiteI done white to link leads color now link leads not see
Then you'll need to change the color of the links (using CSS).
Gert G
A: 

I have more than one element with the same "id" value ("ifr2") but I changed "id" valume.Now no problem :)