HTML: Difference between revisions

From NSB App Studio
Jump to navigation Jump to search
No edit summary
 
(20 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Html <br />
HTML <br />
:::[''statements''] <br />
:::[''statements''] <br />
End Html
End HTML


== Description ==
== Description ==


The Html statement allows you to ember pure Html in your NS Basic/X program. This allows you to have additional functionality to your app. Statements within this block must follow all Htnl rules. They are ignored by NS Basic/X  itself. For more information, see the Tech Note ‘The role of JavaScript and WebKit’.
'''This statement is deprecated in AppStudio 6. Put the statements inside your Style...End Style block into Project CSS, in the Project menu.'''


== Example ==
The HTML statement allows you to embed pure HTML in your app. This allows you to have additional functionality to your app. Statements within this block must follow all HTML rules and can only appear within BASIC code. For more information, see the Tech Note ‘The role of JavaScript, HTML5 and WebKit’.
 
It will be subject to all the regular rules of page formatting. If some other element is on top of it, it will not be visible. The z-index property can be used to change the hierarchy of where the element gets drawn.
 
Do not embed &lt;script> or &lt;style> elements inside an HTML block. Use [[Javascript...End Javascript|JavaScript]] and [[Style/End Style|Style]] instead.
 
== Example (Basic) ==


<pre>
<pre>
'This sample shows how to add a button at runtime.
'This sample shows how to add a button at runtime.
   
   
Html
HTML
   <button onmousedown="button1()">Button 1</button>
   <button onmousedown="button1()">Button 1</button>
   <div id="box">Box</div>
   <div id="box">Box</div>
End Html
End HTML
 
Sub Main()
  'Hide the form, otherwise our elements will be hidden by it
  Form1.hide()
End Sub
   
   
Function button1()
Function button1()
   box.innerHtml= event.screenX & ", " & event.screenY
   box.innerHTML= event.screenX & ", " & event.screenY
End Function
End Function
</pre>
</pre>
Line 30: Line 41:
== Related Items ==
== Related Items ==


[[javascript|JAVASCRIPT]]
[//en.wikipedia.org/wiki/JavaScript JavaScript]


[[Category:Language Reference]]
[[Category:Language Reference]]
[[Category:Statements - Flow of control]]

Latest revision as of 13:03, 12 June 2017

HTML

[statements]

End HTML

Description

This statement is deprecated in AppStudio 6. Put the statements inside your Style...End Style block into Project CSS, in the Project menu.

The HTML statement allows you to embed pure HTML in your app. This allows you to have additional functionality to your app. Statements within this block must follow all HTML rules and can only appear within BASIC code. For more information, see the Tech Note ‘The role of JavaScript, HTML5 and WebKit’.

It will be subject to all the regular rules of page formatting. If some other element is on top of it, it will not be visible. The z-index property can be used to change the hierarchy of where the element gets drawn.

Do not embed <script> or <style> elements inside an HTML block. Use JavaScript and Style instead.

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 

Sub Main()
  'Hide the form, otherwise our elements will be hidden by it
  Form1.hide()
End Sub
 
Function button1()
  box.innerHTML= event.screenX & ", " & event.screenY
End Function

Output

(a button and a box are displayed. Click the button and text is put in the box)

Related Items

JavaScript