What is the difference between “[removed]”, “#”, a

2019-05-27 12:21发布

If I want to set the src of iframe with these 3 value. I found:

  1. javascript: doesn't work in IE10 (error is can't find the page). other mainstream browsers or IE9 is ok.
  2. javascript:false will show a false string in the iframe for IE10, others browsers or IE9 is ok.
  3. # works fine in all the browsers.

What is the difference between them? Which one is the best choice for cross-browser issues?

2条回答
贪生不怕死
2楼-- · 2019-05-27 12:39

Try using about:blank as the URL. This should display a blank page in all browsers.

http://tools.ietf.org/html/rfc6694#section-3

查看更多
我想做一个坏孩纸
3楼-- · 2019-05-27 12:48

If you want an iframe that doesn't load anything right away, then just don't set the src attribute to anything. You can set the .src property later via Javascript to cause it to load something.

查看更多
登录 后发表回答