0

My HTML iframe code

<iframe style="height:500px;width:500px;" src="http://google.co.in"><iframe>

if try show google in my webpage its through the error in console

Refused to display 'https://www.google.co.in/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

Otherwise its works fine for many sites for example .,

<iframe style="height:500px;width:500px;" src="http://www.espncricinfo.com/">

my problem is .,

when try load this URL(www.dinamalar.com) on iframe my webpage (redirected to www.dinamalar.com`)turn to homepage of particular website

is there way to show this site on my web page's iframe..?you can try myURL in this try editor . iframe not working in jsfiddle. http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_iframe

this have to work in my page

<iframe style="height:500px;width:500px;" src="http://www.dinamalar.com/">
Cœur
  • 37,241
  • 25
  • 195
  • 267
P.JAYASRI
  • 358
  • 2
  • 18
  • 2
    It's called a _framebuster_, and the purpose is exactly that: to prevent your page being displayed in (somebody else's) iframe. – Ulrich Schwarz Mar 19 '15 at 11:31
  • @Ulrich Schwarz thanks for your valuable comment . can you explain about 'framebuster' and how to implement in our site.. – P.JAYASRI Mar 19 '15 at 11:33

1 Answers1

1

Wait for your site load completely and only then load your iframe.

$(document).ready(function(){
  $("#myframe").src="http://www.espncricinfo.com/"
});

UPDATE

Try this:

 <script>
    document.addEventListener('DOMContentLoaded', function () {
    setTimeout(function () {
    document.getElementById('myframe').src = "//www.dinamalar.com/";
    }, 2000);
}, false);    
</script>
P.JAYASRI
  • 358
  • 2
  • 18
Diego Gusava
  • 125
  • 1
  • 12