Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / test / data / navigation_interception / navigation_from_xhr_callback.html
blob3d6ec7edcfb88865de7f969c3986162a3fccc5c0
1 <!DOCTYPE html>
2 <html>
3 <!--
5 Copyright (c) 2015 The Chromium Authors. All rights reserved.
6 Use of this source code is governed by a BSD-style license that can be
7 found in the LICENSE file.
9 -->
10 <head>
11 <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
12 <style>
13 #first {
14 position: absolute;
15 width: 100px;
16 height: 100px;
17 top: 0px;
18 left: 0px;
19 background-color: green;
20 -webkit-transform: translate3d(0, 0, 0);
22 </style>
23 <script>
24 var xmlhttp = new XMLHttpRequest();
26 function xhrOnReadyStateChange() {
27 if (xmlhttp.readyState==4 && xmlhttp.status==200) {
28 window.location = 'hello.html';
32 function xhrAndOpenHello(e) {
33 xmlhttp.onreadystatechange = xhrOnReadyStateChange;
34 xmlhttp.open("GET", 'hello.html' , true);
35 xmlhttp.send();
37 e.preventDefault();
40 function setup() {
41 first.ontouchstart = xhrAndOpenHello;
43 </script>
44 </head>
45 <body onload='setup();'>
46 <div id='first'></div>
47 </body>
48 </html>