Project

General

Profile

Support #8158 ยป hello.html

Alex Fedorov, 03/01/2021 05:26 AM

 
<html>
<head>
<style type="text/css">
.widget {
width: 600px;
height: 400px;
margin: 0px auto;
padding: 0px;
border: 0px solid gray;
}

.IE-hidden-iframe {
position: absolute;
top: 0; left: 0;
width: 1px; height: 1px;
visibility: hidden;
}
</style>
<title>Embedded Wt</title>

<!-- You need this if you want to use Ext widgets:
-->
<!--[if gte IE 6]>
<script id="ie-deferred-loader" defer="defer" src="//:"></script>
<![endif]-->
</head>
<body>

<!-- These hidden fields are needed for Wt's internal path API
and are optional.

If you use them, then append "&amp;Wt-history=Wt-history" to the Wt
script url, where Wt-history corresponds to the prefix of these fields:
Wt-history-iframe
Wt-history-field

The hidden iframe is only needed for Internet Explorer, so you can
make it conditional:
-->
<!--[if gte IE 6]>
<iframe id="Wt-history-iframe" src="/hello.js?request=resource&resource=blank"
class="IE-hidden-iframe">
</iframe>
<![endif]-->
<input id="Wt-history-field" type="hidden"/>

<!-- End hidden fields for Wt's internal path API -->

<!--
We need a place holder for every widget to which we want to bind
a WContainerWidget in Wt
-->
<div id="chart" class="widget"></div>

<!--
As the last step, we load our application.
-->
<!--<script src="http://127.0.0.1:8080/hello.js?div=chart&amp;Wt-history=Wt-history"></script>-->
<script src="http://127.0.0.1:8080/hello.js?div=chart"></script>
<script type="text/javascript">
/*<![CDATA[*/


$(document).ready(function()
{
alert("The DOM is ready!");
const url='http://127.0.0.1:8080/hello.js';
alert("POST request");
var xhr = new XMLHttpRequest();
xhr.open("POST", url, true);
xhr.setRequestHeader("dataset", "test");
xhr.onreadystatechange = function()
{
if (this.readyState === XMLHttpRequest.DONE && this.status === 200)
{
// Request finished. Do processing here.
alert("POST request is finished");
}
}
xhr.send("IGL-init");
})

/* ]]> */
</script>
</body>
</html>
    (1-1/1)