GT2/GT2-iOS/node_modules/winchan/complex_example/index.html

62 lines
1.4 KiB
HTML
Raw Normal View History

2018-02-12 17:26:06 +00:00
<!DOCTYPE html>
<html>
<body>
<p>
hi! this is a simple webpage that uses winchan to open a window with
parameters. There are a couple different features of the library you can
manually excercise here:
<br/>
<button id="open">open the window</button>
<br/>
<button id="close">close the window programatically</button>
<br/>
<button id="focus">re-focus the window programatically</button>
</p>
<p>Here&apos;s the response from the window:</p>
<pre>
</pre>
</body>
<script src="../winchan.js"></script>
<script src="jquery.js"></script>
<script>
var w;
if (!window.location.origin) {
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
}
$("#open").click(function(e) {
$("pre").text("");
e.preventDefault();
w = WinChan.open({
url: window.location.origin + "/complex_example/child.html",
relay_url: window.location.origin + "/relay.html",
window_features: "menubar=0,location=0,resizable=0,scrollbars=0,status=0,dialog=1,width=700,height=375",
params: {
these: "things",
are: "input parameters",
the: "interface",
is_beautiful: true,
timestamp: new Date().toString()
}
},
function(err, r) {
$("pre").text("error: " + err + "\n\nresponse: " + JSON.stringify(r, null, " "));
});
});
$("#close").click(function(e) {
w.close();
});
$("#focus").click(function(e) {
w.focus();
});
</script>
</html>