imag.js| Fast Mastering the global Approach

Source: Internet
Author: User


In addition to understanding basic content controls, form controls, and layout controls, it is more important to master the scripting features when using mobile app development with love code. Scripting is essential for interaction and invocation between interfaces, making full use of the scripting features that make apps move rather than simply static pages.

The following is a brief introduction to the global approach Http://www.imagapp.com/doc/global in scripting, and the global approach mainly includes the following sections.



$ (id:string); Get Control Object


var button = $ (' Test_button ');


$C (xml:string); through XML To create a control object


var button = $C (' <button id= ' Test_button ' > button </button> '); For Listitemvar ListItem = $C (' <list-item><item href= ' detail.xml ' ><label> text content </label></ Item></list-item> ');//for Griditemvar GridItem = $C (' <grid-item><item href= ' detail.xml ' >< label> text content </label></item></grid-item> ');  

alert (text:string); Prompt Box

<button onclick= "alert (' Exit login ')" > Click button </button>//as long as the control with the OnClick property can be used

alert (title|text:string); Cue box (with caption)

<button onclick= "alert (' Exit Login | exit ') ' > click button </button>

Confirm (title|text:string); Confirmation Box (with title)

<?xml version= "1.0" encoding= "Utf-8"?><imag>    <script>    <![ cdata[        function testconfirm () {                if (confirm (' Exit login | ok? ') {                    hint (' OK ');                } else {                    hint (' Cancel ');                }        ]] >    </script>    <page>        <title style= "background: #acacac" >            <center>            <label> Global Methods </label>            </center>        </title>        <content draggable= "true ">            <button onclick=" testconfirm () "> Click button </button>        </content>    </page> </imag>


Full Code Https://github.com/imagjs/Global-method/blob/master/index.xml


imag.js| Fast Mastering the global Approach

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.