This time I have found an interesting issue with Google Chrome browser.
The problem appears when you try to access the code from within the iframe which source has an url from the same domain.
For example you have two simple html files on your computer (ie page1.html and page2.html), where one of them contains an iframe:
Note: I am using jQuery.
The above will give you an error in Google Chrome when you will open the file directly from windows explorer. The error will look like this:
For some reason Google Chrome considers page2.html a different domain and does not allow to access the content of the frame.
However this error will not appear if you will open those pages through Visual Studio, by doing the following steps:
- Open Visual Studio;
- Go to File -> Open -> Web Site;
- Select the folder where your html files are located;
- Press Open;
- Select the starting file;
- Right Click on it and press: View in Browser;
- Now your pages will work correctly without any errors.
I hope this article helped you and ... thanks for visiting my blog.
Please share this article with others!