Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : javascript

ÈçºÎÎÒjavaScript»ñÈ¡´°¿ÚµÄ¸ß¶ÈºÍ¿í¶È

ÔÚjavascriptÖеõ½µ±Ç°´°¿ÚµÄ¸ßºÍ¿í
<body><SCRIPT LANGUAGE="JavaScript">
var  s = "";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.clientWidth;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.clientHeight;
s += "\r\nÍøÒ³¿É¼ûÇøÓò¿í£º"+ document.body.offsetWidth  +" (°üÀ¨±ßÏߺ͹ö¶¯ÌõµÄ¿í)";
s += "\r\nÍøÒ³¿É¼ûÇøÓò¸ß£º"+ document.body.offsetHeight +" (°üÀ¨±ßÏߵĿí)";
s += "\r\nÍøÒ³ÕýÎÄÈ«ÎÄ¿í£º"+ document.body.scrollWidth;
s += "\r\nÍøÒ³ÕýÎÄÈ«Îĸߣº"+ document.body.scrollHeight;
s += "\r\nÍøÒ³±»¾íÈ¥µÄ¸ß£º"+ document.body.scrollTop;
s += "\r\nÍøÒ³±»¾íÈ¥µÄ×ó£º"+ document.body.scrollLeft;
s += "\r\nÍøÒ³ÕýÎIJ¿·ÖÉÏ£º"+ window.screenTop;
s += "\r\nÍøÒ³ÕýÎIJ ......

jLayout — JavaScript Layout Algorithms


The jLayout JavaScript library provides layout algorithms for laying out components. A component is an abstraction; it can be implemented in many ways, for example as items in a HTML5 Canvas drawing or as HTML elements. The jLayout library allows you to focus on drawing the individual components instead of on how to arrange them on your screen.
The library currently provides four layout algorithms: border, which lays out components in five different regions;grid, which lays out components in a user defined grid, flex-grid which offers a grid with flexible column and row sizes, and flow which flows components in a user defined direction. Using the grid and flex-grid algorithms you can also create horizontal and vertical layouts. A jQuery plugin to lay out (X)HTML elements is also available.
http://www.bramstein.com/projects/jlayout/ ......

JavaScript ¶ÁÈ¡ JSON


JSON:
[{"subjecttypeId":"1","subjectName":"67","scope":"1",},{"subjecttypeId":"1","subjectName":"345","scope":"1"}]
JavaScript:
       var result = window.eval('(' + JSON+ ')');

for(var p in result){

result[p].subjectName;

alert(result[p].subjectName);

         } ......

JavascriptÎļþ¼°Îļþ¼Ð²Ù×÷

JavascriptÎļþ¼°Îļþ¼Ð²Ù×÷
 
Ò»¡¢¹¦ÄÜʵÏÖºËÐÄ£ºFileSystemObject ¶ÔÏó
    ÒªÔÚjavascriptÖÐʵÏÖÎļþ²Ù×÷¹¦ÄÜ£¬Ö÷Òª¾ÍÊÇÒÀ¿¿FileSystemobject¶ÔÏó¡£
¶þ¡¢FileSystemObject±à³Ì
ʹÓÃFileSystemObject ¶ÔÏó½øÐбà³ÌºÜ¼òµ¥£¬Ò»°ãÒª¾­¹ýÈçϵIJ½Ö裺 ´´½¨FileSystemObject¶ÔÏó¡¢Ó¦ÓÃÏà¹Ø·½·¨¡¢·ÃÎʶÔÏóÏà¹ØÊôÐÔ ¡£
£¨Ò»£©´´½¨FileSystemObject¶ÔÏó
´´½¨FileSystemObject¶ÔÏóµÄ´úÂëÖ»Òª1ÐУº
var fso = new ActiveXObject("Scripting.FileSystemObject");
ÉÏÊö´úÂëÖ´Ðкó£¬fso¾Í³ÉΪһ¸öFileSystemObject¶ÔÏóʵÀý¡£
£¨¶þ£©Ó¦ÓÃÏà¹Ø·½·¨
´´½¨¶ÔÏóʵÀýºó£¬¾Í¿ÉÒÔʹÓöÔÏóµÄÏà¹Ø·½·¨ÁË¡£±ÈÈ磬ʹÓÃCreateTextFile·½·¨´´½¨Ò»¸öÎı¾Îļþ£º
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.createtextfile("c:\\myjstest.txt",true");
£¨Èý£©·ÃÎʶÔÏóÏà¹ØÊôÐÔ
Òª·ÃÎʶÔÏóµÄÏà¹ØÊôÐÔ£¬Ê×ÏÈÒª½¨Á¢Ö¸Ïò¶ÔÏóµÄ¾ä±ú£¬Õâ¾ÍҪͨ¹ýgetϵÁз½·¨ÊµÏÖ£ºGetDrive¸ºÔð»ñÈ¡Çý¶¯Æ÷ÐÅÏ¢£¬GetFolder¸ºÔð»ñÈ¡Îļþ¼ÐÐÅÏ¢£¬GetFile¸ºÔð»ñÈ¡ÎļþÐÅÏ¢¡£±ÈÈ磬ָÏòÏÂÃæµÄ´úÂëºó£¬f1¾Í³ÉΪָÏòÎļþc:\test.txtµÄ¾ä±ú£º
var fso = ......

Javascript ʹÓÃIDE¹¤¾ß½øÐе÷ÊÔ

1. Javascript Debug Toolkit½éÉÜ
JSDT(Javascript Debug Toolkit)ÊÇÒ»¸öÓÃÓÚjavascriptµ÷ÊÔµÄeclipse
²å¼þ£¬ÓÃÓÚµ÷ÊÔjavascript¡£JSDT¿ÉÒÔ¿çä¯ÀÀÆ÷µ÷ÊÔ£¬Ö§³ÖÔÚIE,Firefox,Safari,ChromeµÈÖ÷Á÷ä¯ÀÀÆ÷Öе÷ÊÔ
javascript¡£JSDTÖ§³ÖÉèÖöϵ㣬µ¥²½µ÷ÊԵȵ÷ÊÔ¹¤¾ßµÄ»ù±¾ÌØÐÔ¡£
2. ÈçºÎ°²×°
JSDTÊÇ»ùÓÚeclipse3.2+,jdk1.5+»ù´¡¿ª·¢µÄ£¬Òò´Ë°²×°JSDTÇ°Ó¦µ±ÏÈ°²×°jdk1.5+ºÍeclipse3.2+¡£
JSDTÏÂÔصØÖ·£ºhttp://code.google.com/p/jsdt/downloads/list
,ÆäÖÐjsdt-1.0.0.zipÊÇJSDTµÄ°²×°°ü£¬ÏÂÔØ°ÑÆäÖеÄÈý¸öjar°ü½âѹµ½eclipseµÄpluginsĿ¼Ï£¬ÖØÆôeclipse¼´¿É¡£
jsdt-simple.swfÊÇÒ»¶ÎʹÓÃjsdtÔÚchromeä¯ÀÀÆ÷µ÷ÊÔjavascriptµÄ¼òµ¥Àý×ӵļÏó¡£
jsdt-ext-desktop.swfÊÇÒ»¶ÎʹÓÃjsdtÔÚsafariä¯ÀÀÆ÷µ÷ÊÔjavascriptµÄ¼Ïó¡£
3.ÈçºÎʹÓÃ
1.       ÔÚeclipseÖдò¿ªµ÷ÊÔ¶Ô»°¿ò£¬ÈçÏÂͼËùʾ£º
2.       н¨Ò»¸öJavascript Debug£¬ÈçÏÂͼËùʾ
ÔÚurlÖÐÊäÈëÒªµ÷ÊÔµÄurl--±¾µØÎļþÃû»ò·þÎñÆ÷ÉϵÄÎļþÃû(Ö»Ö§³ÖhttpÀàÐ͵Äurl)¡£ÔÚbrowserÊäÈë¿òÖÐÑ¡Ôñä¯ÀÀÆ÷(ie,firefox,safari»òchromeµÈ)
µã»÷µ÷ÊÔºó»á´ò¿ªä¯ÀÀÆ÷£ ......

javascript String.replaceº¯Êý

    javascriptµÄStringÀàÄÚÖú¯Êýreplace(regexp, newString)º¯ÊýÌṩÁË×Ö·û´®Ìæ»»¹¦ÄÜ£¬´Óº¯ÊýÔ­ÐÍÉÏ¿ÉÒÔ¿´³öÖ§³Ö Regular Exp¡£´Ëº¯Êý¹¦Äܷdz£ÊµÓ㬵«Ò²Óм¸¸öµØ·½Óеã»ìÏý£¬ÏÂÃæͨ¹ýʵ¼ÊµÄÀý×ÓÀ´ËµÃ÷£º
    ±ÈÈçÎÒÃÇÏÖÔÚÒªÕë¶Ô´®
var src="<a href=&quot;http://xx.com/a/20100601/000224.htm&quot; target=&quot;_blank&quot;>xxx</a>"
ÒªÌæ»»ÆäÖеÄHTMLË«ÒýºÅµÄתÒÆ·û &quot; Ϊʵ¼ÊµÄ " , Õý³£ÎÒÃǾͻáÖ±½Óµ÷Óà src.replace(/&quot;/g, '"');À´´ïµ½Ä¿µÄ£¬µ«ÊÇjsÈÝÒ×ÈÃÈËÃÔ»óµÄÒ»µã¾ÍÊÇ£¬ÕâÑù×ö²¢Ã»ÓÐʵ¼Ê¸Ä±äsrcµÄÖµ£¬Êµ¼Ê²âÊÔ·¢ÏÖ·µ»ØÖµ²ÅÊÇÎÒÃÇÐèÒªµÄ½á¹û£¬¶øsrc±¾ÉíÈ·²»·¢Éú±ä»¯£¬ËùÒÔʵ¼ÊÖÐÐèҪͨ¹ýÈçÏÂÀ´Íê³ÉÎÒÃǵŦÄÜ£º
     src=src.replace(/&quot;/g, '"'); ......
×ܼǼÊý:2244; ×ÜÒ³Êý:374; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [1] [2] 3 [4] [5] [6] [7] [8] [9] [10]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ