ExtJS environment Construction needs to introduce 2 problems a CSS a js__js
Source: Internet
Author: User
<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "
pageencoding= "UTF-8"%>
<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "HTTP://WWW.W3.ORG/TR/HTML4/LOOSE.DTD" >
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<title>insert title here</title>
<!--the introduction of ExtJS CSS style files-->
<link rel= "stylesheet" type= "Text/css"
href= "Extjs/resources/css/ext-all.css" >
<script type= "Text/javascript" src= "Extjs/adapter/ext/ext-base.js" ></script>
<script type= "Text/javascript" src= "Extjs/bootstrap.js" ></script>
<script type= "Text/javascript" >
Ext.onready (function () {
Alert ("Started");
Pop up a hint box ext equals namespace
Ext.MessageBox.alert ("AAAAA");
Ext.MessageBox.alert ("title", "Here is content");
JavaScript class
function User (name, sex, age) {
THIS.name = name;
This.sex = sex;
This.age = age;
This.showmsg = function () {
Ext.MessageBox.alert ("Demo JS original object Creation Method", "Create user1 name is = = =
+ this[' name '] + "gender is =====" + this[' sex ']
+ "The age is = = = = = =" + this[' ages ']);
}
}
To create an object of a class
var user1 = new User ("Little Cool", "female", "1");
User1.name user1[' name ']
Ext.MessageBox.alert ("Demo JS original object Creation Method", "Create user1 pair name is = = = = = = = = =" +user1[' name '));
User1.showmsg ();
var user2 = {
Name: "Little Wolf",
Sex: "Male",
Age: "2",
Tostring:function () {
Ext.MessageBox.alert ("Demo JS original object Creation Method", "Create User2 object name is:"
+ this[' name '] + "gender is:" + this[' sex '] + "age is:"
+ this[' age ']);
}
};
User2.tostring ();
Array arrays
var arrs = [1, 2, 3, 4,-3,-4];
Traversing an array-------the old way
/*for (var i=0;i<arrs.length;i++) {
Alert (Arrs[i]);
}
Exclusion with filter value less than 0
for (Var i=0;i<arrs.length;i++) {
if (arrs[i]>0) {
Alert (Arrs[i]);
}
}*/
var newarrs = Ext.Array.filter (Arrs, function (item) {
if (item > 0) {
True or False if you return the array element if it is false, the array element is not preserved
return true;
} else {
Do not process operations
return false;
}
}, this);
Alert (Newarrs.join ("\ n"));
Ext.Array.each (Newarrs, function (item) {
alert (item);
});
});
</script>
<body>
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