{"id":12,"date":"2009-05-22T20:54:37","date_gmt":"2009-05-22T12:54:37","guid":{"rendered":"http:\/\/www.bluesdream.com\/blog\/?p=12"},"modified":"2009-10-04T23:07:20","modified_gmt":"2009-10-04T15:07:20","slug":"javascript-syntax","status":"publish","type":"post","link":"https:\/\/www.bluesdream.com\/blog\/javascript-syntax.html","title":{"rendered":"Javascript\u7684107\u5219\u4f7f\u7528\u6280\u5de7\u5927\u5168"},"content":{"rendered":"<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">1.document.write(\"\"); \u8f93\u51fa\u8bed\u53e5 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">2.JS\u4e2d\u7684\u6ce8\u91ca\u4e3a\/\/ <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">3.\u4f20\u7edf\u7684HTML\u6587\u6863\u987a\u5e8f\u662f:document-&gt;html-&gt;(head,body) <!--more--><\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">4.\u4e00\u4e2a\u6d4f\u89c8\u5668\u7a97\u53e3\u4e2d\u7684DOM\u987a\u5e8f\u662f:window-&gt;(navigator,screen,history,location,document)\u00a0<\/span>\u00a0<\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">5.\u5f97\u5230\u8868\u5355\u4e2d\u5143\u7d20\u7684\u540d\u79f0\u548c\u503c:document.getElementById(\"\u8868\u5355\u4e2d\u5143\u7d20\u7684ID\u53f7\").name(\u6216value) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">6.\u4e00\u4e2a\u5c0f\u5199\u8f6c\u5927\u5199\u7684js: document.getElementById(\"output\").value = document.getElementById(\"i <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">nput\").value.toUpperCase(); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">7.JS\u4e2d\u7684\u503c\u7c7b\u578b:String,Number,Boolean,Null,Object,Function <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">8.JS\u4e2d\u7684\u5b57\u7b26\u578b\u8f6c\u6362\u6210\u6570\u503c\u578b:parseInt(),parseFloat() <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">9.JS\u4e2d\u7684\u6570\u5b57\u8f6c\u6362\u6210\u5b57\u7b26\u578b:(\"\"+\u53d8\u91cf) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">10.JS\u4e2d\u7684\u53d6\u5b57\u7b26\u4e32\u957f\u5ea6\u662f:(length) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">11.JS\u4e2d\u7684\u5b57\u7b26\u4e0e\u5b57\u7b26\u76f8\u8fde\u63a5\u4f7f\u7528+\u53f7. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">12.JS\u4e2d\u7684\u6bd4\u8f83\u64cd\u4f5c\u7b26\u6709:==\u7b49\u4e8e,!=\u4e0d\u7b49\u4e8e,&gt;,&gt;=,&lt;.&lt;= <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">13.JS\u4e2d\u58f0\u660e\u53d8\u91cf\u4f7f\u7528:var\u6765\u8fdb\u884c\u58f0\u660e <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">14.JS\u4e2d\u7684\u5224\u65ad\u8bed\u53e5\u7ed3\u6784:if(condition){}else{} <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">15.JS\u4e2d\u7684\u5faa\u73af\u7ed3\u6784:for([initial expression];[condition];[upadte expression]) {inside loop} <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">16.\u5faa\u73af\u4e2d\u6b62\u7684\u547d\u4ee4\u662f:break <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">17.JS\u4e2d\u7684\u51fd\u6570\u5b9a\u4e49:function functionName([parameter],...) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">18.\u5f53\u6587\u4ef6\u4e2d\u51fa\u73b0\u591a\u4e2aform\u8868\u5355\u65f6.\u53ef\u4ee5\u7528document.forms[0],document.forms[1]\u6765\u4ee3\u66ff. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">19.\u7a97\u53e3:\u6253\u5f00\u7a97\u53e3window.open(), \u5173\u95ed\u4e00\u4e2a\u7a97\u53e3:window.close(), \u7a97\u53e3\u672c\u8eab:self <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">20.\u72b6\u6001\u680f\u7684\u8bbe\u7f6e:window.status=\"\u5b57\u7b26\"; <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">21.\u5f39\u51fa\u63d0\u793a\u4fe1\u606f:window.alert(\"\u5b57\u7b26\"); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">22.\u5f39\u51fa\u786e\u8ba4\u6846:window.confirm(); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">23.\u5f39\u51fa\u8f93\u5165\u63d0\u793a\u6846:window.prompt(); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">24.\u6307\u5b9a\u5f53\u524d\u663e\u793a\u94fe\u63a5\u7684\u4f4d\u7f6e:window.location.href=\"URL\" <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">25.\u53d6\u51fa\u7a97\u4f53\u4e2d\u7684\u6240\u6709\u8868\u5355\u7684\u6570\u91cf:document.forms.length <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">26.\u5173\u95ed\u6587\u6863\u7684\u8f93\u51fa\u6d41:document.close(); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">27.\u5b57\u7b26\u4e32\u8ffd\u52a0\u8fde\u63a5\u7b26:+= <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">28.\u521b\u5efa\u4e00\u4e2a\u6587\u6863\u5143\u7d20:document.createElement(),document.createTextNode() <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">29.\u5f97\u5230\u5143\u7d20\u7684\u65b9\u6cd5:document.getElementById() <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">30.\u8bbe\u7f6e\u8868\u5355\u4e2d\u6240\u6709\u6587\u672c\u578b\u7684\u6210\u5458\u7684\u503c\u4e3a\u7a7a: <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">var form = window.document.forms[0] <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">for (var i = 0; i if (form.elements.type == \"text\"){ <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">form.elements.value = \"\"; <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">} <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">} <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">31.\u590d\u9009\u6309\u94ae\u5728JS\u4e2d\u5224\u65ad\u662f\u5426\u9009\u4e2d:document.forms[0].checkThis.checked (checked\u5c5e\u6027\u4ee3\u8868\u4e3a\u662f\u5426\u9009\u4e2d <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">\u8fd4\u56deTRUE\u6216FALSE) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">32.\u5355\u9009\u6309\u94ae\u7ec4(\u5355\u9009\u6309\u94ae\u7684\u540d\u79f0\u5fc5\u987b\u76f8\u540c):\u53d6\u5355\u9009\u6309\u94ae\u7ec4\u7684\u957f\u5ea6document.forms[0].groupName.length <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">33.\u5355\u9009\u6309\u94ae\u7ec4\u5224\u65ad\u662f\u5426\u88ab\u9009\u4e2d\u4e5f\u662f\u7528checked. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">34.\u4e0b\u62c9\u5217\u8868\u6846\u7684\u503c:document.forms[0].selectName.options[n].value (n\u6709\u65f6\u7528\u4e0b\u62c9\u5217\u8868\u6846\u540d\u79f0\u52a0\u4e0a.sel <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">ectedIndex\u6765\u786e\u5b9a\u88ab\u9009\u4e2d\u7684\u503c) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">35.\u5b57\u7b26\u4e32\u7684\u5b9a\u4e49:var myString = new String(\"This is lightsword\"); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">36.\u5b57\u7b26\u4e32\u8f6c\u6210\u5927\u5199:string.toUpperCase(); \u5b57\u7b26\u4e32\u8f6c\u6210\u5c0f\u5199:string.toLowerCase(); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">37.\u8fd4\u56de\u5b57\u7b26\u4e322\u5728\u5b57\u7b26\u4e321\u4e2d\u51fa\u73b0\u7684\u4f4d\u7f6e:String1.indexOf(\"String2\")!=-1\u5219\u8bf4\u660e\u6ca1\u627e\u5230. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">38.\u53d6\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u4f4d\u7f6e\u7684\u4e00\u4e2a\u5b57\u7b26:StringA.charAt(9); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">39.\u53d6\u51fa\u5b57\u7b26\u4e32\u4e2d\u6307\u5b9a\u8d77\u70b9\u548c\u7ec8\u70b9\u7684\u5b50\u5b57\u7b26\u4e32:stringA.substring(2,6); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">40.\u6570\u5b66\u51fd\u6570:Math.PI(\u8fd4\u56de\u5706\u5468\u7387),Math.SQRT2(\u8fd4\u56de\u5f00\u65b9),Math.max(value1,value2)\u8fd4\u56de\u4e24\u4e2a\u6570\u4e2d\u7684\u6700 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">\u5728\u503c,Math.pow(value1,10)\u8fd4\u56devalue1\u7684\u5341\u6b21\u65b9,Math.round(value1)\u56db\u820d\u4e94\u5165\u51fd\u6570,Math.floor(Math.ra <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">ndom()*(n+1))\u8fd4\u56de\u968f\u673a\u6570 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">41.\u5b9a\u4e49\u65e5\u671f\u578b\u53d8\u91cf:var today = new Date(); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">42.\u65e5\u671f\u51fd\u6570\u5217\u8868:dateObj.getTime()\u5f97\u5230\u65f6\u95f4,dateObj.getYear()\u5f97\u5230\u5e74\u4efd,dateObj.getFullYear()\u5f97\u5230 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">\u56db\u4f4d\u7684\u5e74\u4efd,dateObj.getMonth()\u5f97\u5230\u6708\u4efd,dateObj.getDate()\u5f97\u5230\u65e5,dateObj.getDay()\u5f97\u5230\u65e5\u671f\u51e0,dat <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">eObj.getHours()\u5f97\u5230\u5c0f\u65f6,dateObj.getMinutes()\u5f97\u5230\u5206,dateObj.getSeconds()\u5f97\u5230\u79d2,dateObj.setTi <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">me(value)\u8bbe\u7f6e\u65f6\u95f4,dateObj.setYear(val)\u8bbe\u7f6e\u5e74,dateObj.setMonth(val)\u8bbe\u7f6e\u6708,dateObj.setDate(va <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">l)\u8bbe\u7f6e\u65e5,dateObj.setDay(val)\u8bbe\u7f6e\u661f\u671f\u51e0,dateObj.setHours\u8bbe\u7f6e\u5c0f\u65f6,dateObj.setMinutes(val)\u8bbe\u7f6e\u5206, <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">dateObj.setSeconds(val)\u8bbe\u7f6e\u79d2 [\u6ce8\u610f:\u6b64\u65e5\u671f\u65f6\u95f4\u4ece0\u5f00\u59cb\u8ba1] <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">43.FRAME\u7684\u8868\u793a\u65b9\u5f0f: [window.]frames[n].ObjFuncVarName,frames[\"frameName\"].ObjFuncVarN <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">ame,frameName.ObjFuncVarName <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">44.parent\u4ee3\u8868\u7236\u4eb2\u5bf9\u8c61,top\u4ee3\u8868\u6700\u9876\u7aef\u5bf9\u8c61 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">45.\u6253\u5f00\u5b50\u7a97\u53e3\u7684\u7236\u7a97\u53e3\u4e3a:opener <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">46.\u8868\u793a\u5f53\u524d\u6240\u5c5e\u7684\u4f4d\u7f6e:this <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">47.\u5f53\u5728\u8d85\u94fe\u63a5\u4e2d\u8c03\u7528JS\u51fd\u6570\u65f6\u7528:(javascript :)\u6765\u5f00\u5934\u540e\u9762\u52a0\u51fd\u6570\u540d <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">48.\u5728\u8001\u7684\u6d4f\u89c8\u5668\u4e2d\u4e0d\u6267\u884c\u6b64js: <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">49.\u5f15\u7528\u4e00\u4e2a\u6587\u4ef6\u5f0f\u7684js: <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">50.\u6307\u5b9a\u5728\u4e0d\u652f\u6301\u811a\u672c\u7684\u6d4f\u89c8\u5668\u663e\u793a\u7684HTML: <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">51.\u5f53\u8d85\u94fe\u548conCLICK\u4e8b\u4ef6\u90fd\u6709\u65f6,\u5219\u8001\u7248\u672c\u7684\u6d4f\u89c8\u5668\u8f6c\u5411a.html,\u5426\u5219\u8f6c\u5411b.html.\u4f8b:dfsadf <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">52.JS\u7684\u5185\u5efa\u5bf9\u8c61\u6709:Array,Boolean,Date,Error,EvalError,Function,Math,Number,Object,RangeError, <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">ReferenceError,RegExp,String,SyntaxError,TypeError,URIError <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">53.JS\u4e2d\u7684\u6362\u884c:\\n <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">54.\u7a97\u53e3\u5168\u5c4f\u5927\u5c0f: <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">55.JS\u4e2d\u7684all\u4ee3\u8868\u5176\u4e0b\u5c42\u7684\u5168\u90e8\u5143\u7d20 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">56.JS\u4e2d\u7684\u7126\u70b9\u987a\u5e8f:document.getElementByid(\"\u8868\u5355\u5143\u7d20\").tabIndex = 1 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">57.innerHTML\u7684\u503c\u662f\u8868\u5355\u5143\u7d20\u7684\u503c:\u5982<\/span><span style=\"font-size: x-small;\">\"how are you\" <\/span><span style=\"font-size: x-small;\">,\u5219innerHTML\u7684\u503c\u5c31\u662f:how are you <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">58.innerTEXT\u7684\u503c\u548c\u4e0a\u9762\u7684\u4e00\u6837,\u53ea\u4e0d\u8fc7\u4e0d\u4f1a\u628a\u8fd9\u79cd\u6807\u8bb0\u663e\u793a\u51fa\u6765. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">59.contentEditable\u53ef\u8bbe\u7f6e\u5143\u7d20\u662f\u5426\u53ef\u88ab\u4fee\u6539,isContentEditable\u8fd4\u56de\u662f\u5426\u53ef\u4fee\u6539\u7684\u72b6\u6001. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">60.isDisabled\u5224\u65ad\u662f\u5426\u4e3a\u7981\u6b62\u72b6\u6001.disabled\u8bbe\u7f6e\u7981\u6b62\u72b6\u6001 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">61.length\u53d6\u5f97\u957f\u5ea6,\u8fd4\u56de\u6574\u578b\u6570\u503c <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">62.addBehavior()\u662f\u4e00\u79cdJS\u8c03\u7528\u7684\u5916\u90e8\u51fd\u6570\u6587\u4ef6\u5176\u6269\u5c55\u540d\u4e3a.htc <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">63.window.focus()\u4f7f\u5f53\u524d\u7684\u7a97\u53e3\u5728\u6240\u6709\u7a97\u53e3\u4e4b\u524d. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">64.blur()\u6307\u5931\u53bb\u7126\u70b9.\u4e0eFOCUS()\u76f8\u53cd. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">65.select()\u6307\u5143\u7d20\u4e3a\u9009\u4e2d\u72b6\u6001. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">66.\u9632\u6b62\u7528\u6237\u5bf9\u6587\u672c\u6846\u4e2d\u8f93\u5165\u6587\u672c:onfocus=\"this.blur()\" <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">67.\u53d6\u51fa\u8be5\u5143\u7d20\u5728\u9875\u9762\u4e2d\u51fa\u73b0\u7684\u6570\u91cf:document.all.tags(\"div(\u6216\u5176\u5b83HTML\u6807\u8bb0\u7b26)\").length <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">68.JS\u4e2d\u5206\u4e3a\u4e24\u79cd\u7a97\u4f53\u8f93\u51fa:\u6a21\u6001\u548c\u975e\u6a21\u6001.window.showModaldialog(),window.showModeless() <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">69.\u72b6\u6001\u680f\u6587\u5b57\u7684\u8bbe\u7f6e:window.status='\u6587\u5b57',\u9ed8\u8ba4\u7684\u72b6\u6001\u680f\u6587\u5b57\u8bbe\u7f6e:window.defaultStatus = '\u6587\u5b57.'; <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">70.\u6dfb\u52a0\u5230\u6536\u85cf\u5939:external.AddFavorite(\"http:\/\/www.dannyg.com\"t;,\"jaskdlf\"); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">71.JS\u4e2d\u9047\u5230\u811a\u672c\u9519\u8bef\u65f6\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c:window.onerror = doNothing; \u6307\u5b9a\u9519\u8bef\u53e5\u67c4\u7684\u8bed\u6cd5\u4e3a:window.on <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">error = handleError; <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">72.JS\u4e2d\u6307\u5b9a\u5f53\u524d\u6253\u5f00\u7a97\u53e3\u7684\u7236\u7a97\u53e3:window.opener,\u652f\u6301opener.opener...\u7684\u591a\u91cd\u7ee7\u7eed. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">73.JS\u4e2d\u7684self\u6307\u7684\u662f\u5f53\u524d\u7684\u7a97\u53e3 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">74.JS\u4e2d\u72b6\u6001\u680f\u663e\u793a\u5185\u5bb9:window.status=\"\u5185\u5bb9\" <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">75.JS\u4e2d\u7684top\u6307\u7684\u662f\u6846\u67b6\u96c6\u4e2d\u6700\u9876\u5c42\u7684\u6846\u67b6 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">76.JS\u4e2d\u5173\u95ed\u5f53\u524d\u7684\u7a97\u53e3:window.close(); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">77.JS\u4e2d\u63d0\u51fa\u662f\u5426\u786e\u8ba4\u7684\u6846:if(confirm(\"Are you sure?\"))else{alert(\"Not Ok\");} <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">78.JS\u4e2d\u7684\u7a97\u53e3\u91cd\u5b9a\u5411:window.navigate(\"http:\/\/www.sina.com.cn\"t;); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">79.JS\u4e2d\u7684\u6253\u5370:window.print() <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">80.JS\u4e2d\u7684\u63d0\u793a\u8f93\u5165\u6846:window.prompt(\"message\",\"defaultReply\"); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">81.JS\u4e2d\u7684\u7a97\u53e3\u6eda\u52a8\u6761:window.scroll(x,y) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">82.JS\u4e2d\u7684\u7a97\u53e3\u6eda\u52a8\u5230\u4f4d\u7f6e:window.scrollby <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">83.JS\u4e2d\u8bbe\u7f6e\u65f6\u95f4\u95f4\u9694:setInterval(\"expr\",msecDelay)\u6216setInterval(funcRef,msecDelay)\u6216setTimeou <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">t <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">84.JS\u4e2d\u7684\u6a21\u6001\u663e\u793a\u5728IE4+\u884c,\u5728NN\u4e2d\u4e0d\u884c:showModalDialog(\"URL\"[,arguments][,features]); <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">85.JS\u4e2d\u7684\u9000\u51fa\u4e4b\u524d\u4f7f\u7528\u7684\u53e5\u67c4:function verifyClose(){event.returnValue=\"we really like you and ho <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">pe you will stay longer.\";}} window.onbeforeunload=verifyClose; <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">86.\u5f53\u7a97\u4f53\u7b2c\u4e00\u6b21\u8c03\u7528\u65f6\u4f7f\u7528\u7684\u6587\u4ef6\u53e5\u67c4:onload() <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">87.\u5f53\u7a97\u4f53\u5173\u95ed\u65f6\u8c03\u7528\u7684\u6587\u4ef6\u53e5\u67c4:onunload() <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">88.window.location\u7684\u5c5e\u6027: protocol(http:),hostname(example.com),port(80),host(e <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">xample.com:80),pathname(\"\/a\/a.html\"),hash(\"#giantGizmo\",\u6307\u8df3\u8f6c\u5230\u76f8\u5e94\u7684\u951a\u8bb0),href(\u5168\u90e8\u7684\u4fe1 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">\u606f) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">89.window.location.reload()\u5237\u65b0\u5f53\u524d\u9875\u9762. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">90.window.history.back()\u8fd4\u56de\u4e0a\u4e00\u9875,window.history.forward()\u8fd4\u56de\u4e0b\u4e00\u9875,window.history.go(\u8fd4\u56de <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">\u7b2c\u51e0\u9875,\u4e5f\u53ef\u4ee5\u4f7f\u7528\u8bbf\u95ee\u8fc7\u7684URL) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">91.document.write()\u4e0d\u6362\u884c\u7684\u8f93\u51fa,document.writeln()\u6362\u884c\u8f93\u51fa <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">92.document.body.noWrap=true;\u9632\u6b62\u94fe\u63a5\u6587\u5b57\u6298\u884c. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">93.\u53d8\u91cf\u540d.charAt(\u7b2c\u51e0\u4f4d),\u53d6\u8be5\u53d8\u91cf\u7684\u7b2c\u51e0\u4f4d\u7684\u5b57\u7b26. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">94.\"abc\".charCodeAt(\u7b2c\u51e0\u4e2a),\u8fd4\u56de\u7b2c\u51e0\u4e2a\u5b57\u7b26\u7684ASCii\u7801\u503c. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">95.\u5b57\u7b26\u4e32\u8fde\u63a5:string.concat(string2),\u6216\u7528+=\u8fdb\u884c\u8fde\u63a5 <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">96.\u53d8\u91cf.indexOf(\"\u5b57\u7b26\",\u8d77\u59cb\u4f4d\u7f6e),\u8fd4\u56de\u7b2c\u4e00\u4e2a\u51fa\u73b0\u7684\u4f4d\u7f6e(\u4ece0\u5f00\u59cb\u8ba1\u7b97) <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">97.string.lastIndexOf(searchString[,startIndex])\u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">98.string.match(regExpression),\u5224\u65ad\u5b57\u7b26\u662f\u5426\u5339\u914d. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">99.string.replace(regExpression,replaceString)\u66ff\u6362\u73b0\u6709\u5b57\u7b26\u4e32. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">100.string.split(\u5206\u9694\u7b26)\u8fd4\u56de\u4e00\u4e2a\u6570\u7ec4\u5b58\u50a8\u503c. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">101.string.substr(start[,length])\u53d6\u4ece\u7b2c\u51e0\u4f4d\u5230\u6307\u5b9a\u957f\u5ea6\u7684\u5b57\u7b26\u4e32. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">102.string.toLowerCase()\u4f7f\u5b57\u7b26\u4e32\u5168\u90e8\u53d8\u4e3a\u5c0f\u5199. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">103.string.toUpperCase()\u4f7f\u5168\u90e8\u5b57\u7b26\u53d8\u4e3a\u5927\u5199. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">104.parseInt(string[,radix(\u4ee3\u8868\u8fdb\u5236)])\u5f3a\u5236\u8f6c\u6362\u6210\u6574\u578b. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">105.parseFloat(string[,radix])\u5f3a\u5236\u8f6c\u6362\u6210\u6d6e\u70b9\u578b. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">106.isNaN(\u53d8\u91cf):\u6d4b\u8bd5\u662f\u5426\u4e3a\u6570\u503c\u578b. <\/span><\/p>\n<p style=\"text-indent: 2em;\"><span style=\"font-size: x-small;\">107.\u5b9a\u4e49\u5e38\u91cf\u7684\u5173\u952e\u5b57:const,\u5b9a\u4e49\u53d8\u91cf\u7684\u5173\u952e\u5b57:var<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.document.write(\"\"); \u8f93\u51fa\u8bed\u53e5 2.JS\u4e2d\u7684\u6ce8\u91ca\u4e3a\/\/ 3.\u4f20\u7edf\u7684HTML\u6587\u6863\u987a\u5e8f\u662f:document-&gt;html-&gt;(head,body)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[15],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-program","tag-javascript"],"_links":{"self":[{"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/posts\/12"}],"collection":[{"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/comments?post=12"}],"version-history":[{"count":0,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/posts\/12\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/media?parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/categories?post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bluesdream.com\/blog\/wp-json\/wp\/v2\/tags?post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}