IntroductionGetting started is still very simple. This section describes a simple Hello World application. Please note: You need to create your runtime environment by calling the STATIC NS2112.portalMan.loadCore() method. Please also note: This function will do a bunch of things (including the network task of loading and evaluating even more Javascript files). Details- The full HTML for the Hello World sample:
<HTML>
<HEAD>
<style type="text/css">
body {
margin:0;
padding:0;
width: 100%;
height: 100%;
}
</style>
<!-- The very central stylesheet for your windows -->
<link type="text/css" rel="stylesheet" href="../assets/window12.css">
<script type="text/javascript" src="/yui/build/yahoo/yahoo.js"></script>
<script type="text/javascript" src="/yui/build/event/event.js" ></script>
<script type="text/javascript" src="/yui/build/yuiloader/yuiloader-beta.js"></script>
<script type="text/javascript" src="/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="/yui/build/container/container.js"></script>
<script type="text/javascript" src="/yui/build/json/json.js"></script>
<!-- The Portals Namespace -->
<script type="text/javascript" src="/2112PowerWindows/runtime12/NS2112.js"></script>
<script type="text/javascript" src="/2112PowerWindows/config/portalSettings.js"></script>
<script type="text/javascript" src="/2112PowerWindows/runtime12/snapLoader.js"></script>
<script type="text/javascript" src="/2112PowerWindows/runtime12/portalMan.js"></script>
<script type="text/javascript" src="/2112PowerWindows/runtime12/coreSnapIn.js"></script>
<!-- Make sure that YAHOO is defined before using snapIn! -->
<script type="text/javascript">
f1 = function()
{
//NS2112.sandboxMode = true ; //your decision - see wiki for details...
NS2112.portalMan.loadCore() ;
}
f2 = function()
{
NS2112.masterControl.embedObject( "<H1>Hello World!</H1>", 'Hello World') ;
}
</script>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>A Hello from PowerWindows...</TITLE>
</HEAD>
<BODY background="/2112PowerWindows/assets/img/info_back.jpg">
</div>
<button id="test0" onclick="f1();">Create </button >
<button id="test1" onclick="f2();">Hello World! </button >
</BODY>
</HTML>
|