Last active
March 25, 2021 01:33
-
-
Save vagdwd/c6a0a608a58675855ed5 to your computer and use it in GitHub Desktop.
Iframe without src attribute - javascript vs about:blank vs #
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:false: | |
IE10 and FF (checked in v23 in Linux) will show 'false' as content. | |
javascript:void(0) && javascript:;: | |
IE will show 'cannot display the webpage' error in the iframe. Also, when setting the src from a valid url to javascript:void(0), the page will not get blank. | |
about:blank: | |
Works in all browsers but IE 9 sends an request to the server with path "null". Still the best bet IMO | |
Checkout http://jsfiddle.net/eybDj/1 | |
Checkout http://jsfiddle.net/sv_in/gRU3V/ to see how iframe src changes on dynamic updation with JS | |
source: http://stackoverflow.com/questions/4284605/iframe-without-an-src-attribute |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment