Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Test for window.open() when browser is in fullscreen</title>
5 </head>
6 <body>
7 <script>
8 window.addEventListener("load", function onLoad() {
9 window.removeEventListener("load", onLoad, true);
11 document.getElementById("test").addEventListener("click", onClick, true);
12 }, true);
14 function onClick(aEvent) {
15 aEvent.preventDefault();
17 var dataStr = aEvent.target.getAttribute("data-test-param");
18 var data = JSON.parse(dataStr);
19 window.open(data.uri, data.title, data.option);
20 }
21 </script>
22 <a id="test" href="" data-test-param="">Test</a>
23 </body>
24 </html>