javascript
µÚÒ»Ìâ
±àдһ¸ö·½·¨ ÇóÒ»¸ö×Ö·û´®µÄ×Ö½Ú³¤¶È
µÚ¶þÌâ
ÈçºÎ¿ØÖÆalertÖеĻ»ÐÐ
µÚÈýÌâ
½âÊÍdocument.getElementById("ElementID").style.fontSize="1.5em"
µÚËÄÌâ
½«Ò»¸öÀàËÆͼÖеÄЧ¹û·ÖÀë³ÉcssºÍhtml
µÚÎåÌâ
°´ÕÕ¸ñʽ xxxxÄêxxÔÂxxÈÕxxʱxx·ÖxxÃ붯̬ÏÔʾʱ¼ä ÒªÇó²»×ã10µÄ²¹0
µÚÁùÌâ
±àдһ¸ö·½·¨ È¥µôÒ»¸öÊý×éµÄÖظ´ÔªËØ
µÚÆßÌâ
˵³ö3ÌõÒÔÉÏffºÍieµÄ½Å±¾¼æÈÝÎÊÌâ
µÚ°ËÌâ
°´ÒªÇóдһ¸ö¼òµ¥µÄajaxʾÀý ¼òµ¥µÄûÒâÒå ¾Í²»Ð´ÁË
תÌùÇë×¢Ã÷ : http://www.pghome.net Ö¾Ô¶¹¤×÷ÊÒ
1.
<script language="javascript" type="text/javascript">
new function(s)
{
if(!arguments.length||!s) return null;
if(""==s) return 0;
var l=0;
for(var i=0;i<s.length;i++)
{
if(s.charCodeAt(i)>255) l+=2;
else l++;
}
alert(l);
}("helloÄãºÃ£¬ÎÒºÃ,´ó¼ÒºÃ£¡world!");
</script>
2.
<script language="javascript" type="text/javascript">
alert("hello\nworld");
</script>
3.
emÊǸöÏà¶Ôµ¥Î»¡£
5.
<script language="javascript" type="text/javascript">
new function()
{
with(new Date())
{
var t=function(a){return a<10?"0"+a:a;}
alert(getFullYear()+"Äê"+t(getMonth()+1)+"ÔÂ"+t(getDate())+"ÈÕ"+t(getHours())+"ʱ"+t(getMinutes())+"·Ö"+t(getSeconds())+"Ãë");
}
}
</script>
6.
תÌùÇë×¢Ã÷ : http://www.pghome.net Ö¾Ô¶¹¤×÷ÊÒ
<script language="javascript" type="text/javascript">
Array.prototype.strip=function()
{
if(this.length<2) return [this[0]]||[];
var arr=[];
for(var i=0;i<this.length;i++)
{
arr.push(this.splice(i--,1));
for(var j=0;j<this.length;j++)
{
if(this[j]==arr[arr.length-1])
{
this.splice(j--,1);
}
}
}
return arr;
}
var arr=["abc",85,"abc",85,8,8,1,2,5,4,7,8];
alert(arr.strip());
</script>
8.
<html>
<head><title>loading</title></head>
<body>
<div id="load">Êý¾ÝÕýÔÚ¼ÓÔØ......</div>
<script type="text/javascript">
var Browser={
/**
Browser¶ÔÏóÓÃÓÚ¼ì²âä¯ÀÀÆ÷£¬ÆäÖÐÓõ½ÁËIEµÄÌõ¼þ±àÒë
*/
/*@cc_on
isIE:true,
@*/
isFF:window.navigator.appName.toUpperC
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
Òý×Ó
±à³ÌÊÀ½çÀïÖ»´æÔÚÁ½ÖÖ»ù±¾ÔªËØ£¬Ò»¸öÊÇÊý¾Ý£¬Ò»¸öÊÇ´úÂë¡£±à³ÌÊÀ½ç¾ÍÊÇÔÚÊý¾ÝºÍ´úÂëǧ˿ÍòÂƵľÀ²øÖгÊÏÖ³öÎÞÏÞµÄÉú»úºÍ»îÁ¦¡£
Êý¾ÝÌìÉú¾ÍÊÇÎľ²µÄ£¬×ÜÏë±£³Ö×Ô¼º¹ÌÓеı¾É«£»¶ø´úÂëÈ´ÌìÉú»îÆã¬×ÜÏë¸Ä±äÕâ¸öÊÀ½ç¡£
Äã¿´£¬Êý¾Ý´úÂë¼äµÄ¹ØϵÓëÎïÖ ......
alert(parseInt("101101", 2))
ÔËÐдúÂë
function toBin(intNum) {
var answer = "";
if(/\d+/.test(intNum)) {
while(intNum != 0) {
answer = Math.abs(intNum%2)+answer;
intNum = parseInt(intNum/2);
}
......
http://www.cnblogs.com/webgis8/articles/1516639.html
¼¸¸ö¿ªÔ´JavascriptͼÐοâ
ÒòΪGoogle MapÏîÄ¿µÄÐèÒª,×î½üÒ»Ö±ÔÚÑ°ÇóÏà¹ØµÄJavascriptͼÐοâ,ÔÚ³¢ÊÔÓÃGoogle Map
APIÌṩµÄjavascript½Ó¿Ú»æͼʱ·¢ÏÖÆäЧ¹ûºÍЧÂʶ¼²»Ì«ÀíÏë,ͬʱҲÓùýjsgraphics¿â,Ò²²»ÊǺܺÃ.ÓÖÔÚÍøÉÏÕÒµ½ÁËÏÂÃ漸¸ö.
mxGraph
......
//¹ã¸æÀ¸
function MoveLeftLayer(layerName) {
var x = 5;
var y = 100;// ×ó²à¹ã¸æ¾àÀëÒ³Ê׸߶È
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = parseInt(y)");
e ......