1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00
elinks/test/js/protocol.html
2024-09-24 21:43:10 +02:00

8 lines
897 B
HTML

<p><a href="javascript:document.title = 'This is a test'; document.title += ', this document URL is '+document.url;void(0);">Change the document.title while preventing going anywhere because returning <code>undefined</code>.</a></p>
<p><a href="javascript:document.url='http://elinks.or.cz';">Change the document.url</a> (which is impossible because it's read-only, but the return value of the statement is used as the link target so it magically still works).</p>
<p><a href="javascript:{ document.title = 'This is a test'; document.title += ', this document URL is '+document.url; 'http://elinks.or.cz' }">Change the document.title and go to elinks.or.cz (return value of statement).</a></p>
<p><button onclick="javascript:{ document.title = 'This is a test'; document.title += ', this location protocol is '+ location.protocol }">Change the document.title to location.protocol.</button></p>