Assume that our project directory is as follows:
-- Helloworld.html
| -- JS/
-- Dojo // * This is the file under the dojo package. The list is as follows:
-- Build.txt
-- Changelog
-- Demos
--..
-- Dojo. js
-- Dojo. js. uncompressed. js
-- Iframe_history.html
-- License
-- Readme
-- Src/
Now we create the helloworld.html file,CodeAs follows:
<HTML>
<Head>
<Title> dojo: Hello world! </Title>
<! -- Section 1 -->
<SCRIPT type = "text/JavaScript" src = "JS/dojo. js"> </SCRIPT>
<! -- Section 2 -->
</Head>
<Body>
</Body>
</Html>
Add a widget button to the body.
<Button dojotype = "button" widgetid = "hellobutton"> Hello world! </Button>
You do not have to use widgetid above. You just need to use the usual id. The widget will convert it to widgetid by itself.
The following code adds section 2.
to complete the code of helloworld.html. try it.
Note:
If the init function is already running, use document. getelementbyid
is useless. because Dom
has been changed by the widget. only dojo. widget. byid.