Reputation: 1283
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
I would like to ask what did "javascript:" does in iframe src? I came across this code in a web application.
Basically, what i like about that is that they loaded body content via iframe -> like that google is doing. Does javascript: plays an important part?
E.g. http://www.webapplication.com/#Dashboard:142 Load content from dashboard.php / 142 is userid
E.g. http://www.webapplication.com/#settings:142 Load content from settings.php / 142 is userid
Upvotes: 0
Views: 235
Reputation: 28144
I just built this demo to answer another question: http://jsfiddle.net/JCpgY/
Used in src, javascript allows you to directly inject html strings in the iframe. As far as I know this is supported by all major browsers.
In your case it just allows to assign an empty value to src (this is mandatory). The author could also have used about:blank
or javascript:void 0
.
Upvotes: 0
Reputation: 5084
javascript:''
does absolutely nothing, it is used as a filler. Some use about:blank, or just an empty file, and this is another way.
Upvotes: 5