|
Documentation
#osg documentation. IntroductionExamples Annotations You can use annotations to define some application settings. Exemple: (application code) /
Using if / loop in template. application code (javascript) ... var td = new osg.TemplateData(); td.add("list", ['item1', 'item2', 'item3']); td.add("key", "fasd0f7asdfhasdfalsdf"); setFooPage(td); ... in template/foo.htm Using self::action() this.action() app.action() application code (javascript) ... doSomething:function(id) {...// do something with id.} in template/foo.htm
Complex examples application code (javascript) ... var td = new osg.TemplateData(); td.add("object", {foo:function(p) { alert(p); }}); td.add("lista", [1,2,3,4]); setFooPage(td); ... in template/foo.htm Using include in template/bar.htm <!--#foo.htm--> Using $HOST and $INSTANCE application code (javascript) //$INSTANCE is the main application object. var $INSTANCE = { onInit:function() {}//$HOST is defined in --host IG_FetchXmlContent("$HOST/xml/something.xml", function(){});} |