0
votes

i am trying to load a webpage say "a.html" in a frame in the page "b.html". Also, i am running the script which replaces the url with "a.html" using history.ReplaceState({},"","/a.html") in "b.html". I am running the above script before iframe gets loaded i.e. url of the window changes from "b.html" to "a.html". But as soon as the url changes to "a.html", "a.html" page doesnt load in iframe. Whereas, if i dont run the above script, "a.html" page gets loaded in iframe. Can anyone please tell me why the webpage doesnt load in iframe?

Thanks in advance.

1
Smells like recursion to me. - Giwrgos Tsopanoglou
Extremely sorry, i forgot to mention that i am trying to load "a.html" in an iframe in the page "b.html" i.e. "b.html" contains an iframe "a.html". Also, i am running replaceState() script in "b.html" page. - user2546340

1 Answers

0
votes

Before your page loads, you run replaceState() and redirect your browser to the same page. Which page also runs replaceState() and redirects your browser...... to the same page again. I seems to me that you are forever redirecting your browser to the same page and that's why your iframe won't load