标签:style blog http io ar color os 使用 sp
function Person1(){
this.test = function(){
return 1;
}
}
function Person2(){
}
Person2.prototype.test = function(){
return 1;
}
<!doctype html>
<html >
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css"/>
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var myDiv = Ext.Element.get(‘myID‘);
alert(myDiv);
});
</script>
<body>
<div id=‘myID‘/>
</body>
</html>
<!doctype html>
<html >
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css"/>
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var myDiv = Ext.get(‘myID1‘);
console.debug(‘myDiv=%s‘,myDiv.dom.innerHTML);
Ext.get(‘myID2‘);
console.debug(‘myDiv=%s‘,myDiv.dom.innerHTML);
var myFlyDiv = Ext.fly(‘myID1‘);
console.debug(‘myFlyDiv=%s‘,myFlyDiv.dom.innerHTML);
Ext.fly(‘myID2‘);
console.debug(‘myFlyDiv=%s‘,myFlyDiv.dom.innerHTML);
});
</script>
<body>
<div id="myID1">It‘s a good day</div>
<div id="myID2">It‘s a nice day</div>
</body>
</html>
<!doctype html>
<html >
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<link rel="stylesheet" href="resources/css/ext-all.css" type="text/css"/>
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
$.each($(‘div.demoDiv‘),function(index,node){
Ext.get(node).update("Demo:"+index);
});
});
</script>
<body>
<div class="demoDiv"></div>
<div class="demoDiv"></div>
<div class="demoDiv"></div>
<div class="demoDiv"></div>
</body>
</html>
<!doctype html>
<html >
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css"/>
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var childNode = Ext.get(‘myBookList‘).child(‘ol‘).child(‘li‘);
console.debug(childNode.dom.innerHTML);
});
</script>
<title>Document</title>
</head>
<body>
<div id="myBookList">
<ol id="numberedList">
<li>One Hundred Years of Solitude</li>
<li>Odyssey</li>
<li>Iliad</li>
</ol>
<div id="bookSiteList">
<ul>
<li id="no1">Amazon</li>
<li id="no2">Books</li>
<li id="no3">Page One</li>
</ul>
</div>
</div>
</body>
</html>
var childNode = Ext.get(‘myBookList‘).down(‘li‘);
var childNode = Ext.get(‘myBookList‘).child(‘ol‘).last(‘li‘);
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript">
var result = Ext.DomQuery.is(‘song1‘,‘li:contains(With or without you)‘);
console.debug(result);
</script>
<title>Document</title>
</head>
<body>
<h1>Enterainment</h1>
<div id="myFavoriteBangs">
<h2>My favorite bangs:</h2>
<ol>
<li id="1" class="item">Guns N‘ Roses</li>
<li id="2" class="item">U2</li>
<li id="3" class="item">Aerosmith</li>
<li id="4" class="item">Led Zeppelin</li>
</ol>
</div>
<div id="myFavoriteSong">
<h2>My favorite songs:</h2>
<ol>
<li id="song1" class="item">With or without you</li>
<li id="song2" class="item">Mr.Brownstone</li>
<li id="song3" class="item">Season of wither</li>
</ol>
</div>
</body>
</html>
<!doctype html>
<html >
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css"/>
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var customers =[
{name:‘Aitch Chung‘,age:27, gender:‘Male‘},
{name:‘Mary Wang‘,age:25, gender:‘Female‘},
{name:‘Johncy Fun‘,age:29, gender:‘Female‘}
];
var personTemplate = new Ext.Template(
‘<div class="personInfo">‘,
‘<h3>{name}</h3>‘,
‘<p class="age">Age:{age}</p>‘,
‘<p class="gender">Gender:{gender}</p>‘,
‘</div>‘);
Ext.each(customers, function(customer,index){
personTemplate.append(Ext.getBody(),customer);
},this);
});
</script>
<title>Document</title>
</head>
<body style="padding:10px;">
</body>
</html>
<!doctype html>
<html >
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript">
Ext.onReady(function(){
var saleRecord = {
name: ‘Aitch Chung‘,
age:27,
dob:‘1983-01-01‘,
buyingRecords:[
{id:1, item:‘ipod-classic‘,date:‘2010-01-30‘},
{id:2, item:‘Pilot pen‘, date:‘2010-02-30‘},
{id:3, item:‘Sinn U1‘, date:‘2010-03-30‘ }
]
};
var saleInfoTemplate = new Ext.XTemplate(
‘<div class="sale-style">‘,
‘<p>Name:{name}</p>‘,
‘<p>Age:{age}</p>‘,
‘<p>DOB:{dob}</p>‘,
‘<ol>‘,
‘<tpl for="buyingRecords">‘,
‘<li>‘,
‘ID:{id},‘,‘product:{item},‘,‘Date:{date}‘,
‘</li>‘,
‘</tpl>‘,
‘</ol>‘,
‘</div>‘
);
saleInfoTemplate.compile();
saleInfoTemplate.append(Ext.getBody(),saleRecord);
});
</script>
<body style="padding;10px;">
</body>
</html>
<!doctype html>
<html >
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
<script type="text/javascript" src="js/ext-all.js"></script>
<script type="text/javascript" >
Ext.onReady(function(){
var drinks = [
{type:‘whiskey‘,brand:‘J. Walker‘, prd:‘Red Label‘,age:8},
{type:‘whiskey‘,brand:‘J. Walker‘, prd:‘Black Label‘,age:10},
{type:‘whiskey‘,brand:‘J. Walker‘, prd:‘Green Label‘,age:12},
{type:‘whiskey‘,brand:‘J. Walker‘, prd:‘Blue Label‘,age:16},
{type:‘cognac‘ ,brand:‘Hennessy‘ , prd:‘V.S.O.P‘ ,age:4 },
{type:‘cognac‘ ,brand:‘Hennessy‘ , prd:‘X.O‘ ,age:8}
];
var drinkTemplate = new Ext.XTemplate(
‘<ol>Fine Wines:‘,
‘<tpl for=".">‘,
‘<li>‘,
‘Name:{brand},{prd}‘,
‘<tpl if="type==\‘whiskey\‘&& age >=12">‘,
‘<span style="color:#F00;"> Great Choice</span>‘,
‘</tpl>‘,
‘<tpl if="type==\‘cognac\‘ && age >=8">‘,
‘<span style="color:#F00;"> Great Choice</span>‘,
‘</tpl>‘,
‘</li>‘,
‘</tpl>‘,
‘</ol>‘
);
drinkTemplate.compile();
drinkTemplate.append(Ext.getBody(),drinks);
});
</script>
<title>Document</title>
</head>
<body>
</body>
</html>
标签:style blog http io ar color os 使用 sp
原文地址:http://www.cnblogs.com/shengzhai/p/4146882.html