Commit caf4a79c authored by Philippe Merle's avatar Philippe Merle
Browse files

Moved loading of script "/SayHello?js" from widget.html to Widget.js

Next step is to generate Widget.js automatically from the composite definition.
parent 583f316d
<!-- create an object to talk to the SayHello Web service. -->
var sayHello = new widget_helloworld_examples_frascati_ow2_org__SayHelloPortType_widget_helloworld_examples_frascati_ow2_org__SayHelloPort();
\ No newline at end of file
function includeJs(jsFilePath, callback) {
var js = document.createElement("script");
js.type = "text/javascript";
js.onload = callback
js.src = jsFilePath;
document.head.appendChild(js);
}
<!-- the object to talk to the SayHello Web service. -->
var sayHello;
<!-- Following generates and retrieves a JavaScript client for the SayHello Web service. -->
includeJs("/SayHello?js",
function() {
sayHello = new widget_helloworld_examples_frascati_ow2_org__SayHelloPortType_widget_helloworld_examples_frascati_ow2_org__SayHelloPort()
}
)
......@@ -25,10 +25,10 @@
<html>
<head>
<title>OW2 FraSCAti HelloWorld Widget Example</title>
<!-- Following generates and retrieves a JavaScript client for the SayHello Web service. -->
<script type="text/javascript" src="/SayHello?js"></script>
<!-- Following declares the variable 'sayHello' to invoke the SayHello Web service. -->
<script type="text/javascript" src="Widget.js"></script>
<script type="text/javascript">
<!-- This is the function called upon success. -->
function sayHelloResponse(response)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment