HTML: Difference between revisions
Jump to navigation
Jump to search
Add javascript snippet |
|||
Line 7: | Line 7: | ||
The HTML statement allows you to ember pure HTML in your ap. This allows you to have additional functionality to your app. Statements within this block must follow all HTML rules. They are ignored by App Studio itself. For more information, see the Tech Note ‘The role of JavaScript and WebKit’. | The HTML statement allows you to ember pure HTML in your ap. This allows you to have additional functionality to your app. Statements within this block must follow all HTML rules. They are ignored by App Studio itself. For more information, see the Tech Note ‘The role of JavaScript and WebKit’. | ||
== Example == | == Example (Basic) == | ||
<pre> | <pre> | ||
Line 20: | Line 20: | ||
box.innerHTML= event.screenX & ", " & event.screenY | box.innerHTML= event.screenX & ", " & event.screenY | ||
End Function | End Function | ||
</pre> | |||
== Example (JavaScript) == | |||
<pre> | |||
// This sample shows how to add a button at runtime. | |||
HTML | |||
<button onmousedown="button1()">Button 1</button> | |||
<div id="box">Box</div> | |||
End HTML | |||
Function button1() { | |||
box.innerHTML = event.screenX + ", " + event.screenY; | |||
} | |||
</pre> | </pre> | ||
Revision as of 20:29, 19 May 2013
HTML
- [statements]
- [statements]
End HTML
Description
The HTML statement allows you to ember pure HTML in your ap. This allows you to have additional functionality to your app. Statements within this block must follow all HTML rules. They are ignored by App Studio itself. For more information, see the Tech Note ‘The role of JavaScript and WebKit’.
Example (Basic)
'This sample shows how to add a button at runtime. HTML <button onmousedown="button1()">Button 1</button> <div id="box">Box</div> End HTML Function button1() box.innerHTML= event.screenX & ", " & event.screenY End Function
Example (JavaScript)
// This sample shows how to add a button at runtime. HTML <button onmousedown="button1()">Button 1</button> <div id="box">Box</div> End HTML Function button1() { box.innerHTML = event.screenX + ", " + event.screenY; }
Output
(a button and a box are displayed. Click the button and text is put in the box)