
Javascript
新枯木逢春
这个作者很懒,什么都没留下…
展开
-
web前端面试题
js prototype事件循环原创 2023-02-28 08:18:36 · 93 阅读 · 0 评论 -
Javascript constructor prototype __proto__
function func(){}func.__proto__ === Function.prototype;Function.__proto__ === Function.prototype;Object.__proto__ === Function.prototype;func.constructor === Function;Function.constructor === Function;Object.constructor === Function;func.prototyp.原创 2022-01-21 14:16:26 · 296 阅读 · 1 评论 -
求一个质数的因子/因数
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>求一个质数的因子/因数</title></head><body></body><script type="text/javascript">function primefactory(val){ if(isNaN(Number(val))){ co.原创 2021-09-02 15:01:01 · 150 阅读 · 0 评论 -
当页面上任意一个链接被点击的时候,alert出这个链接在页面上的顺序号
Document body{background-color:pink;font-size:24px;text-align:center;}p{line-height:0.86;} function clickme(x){var dom=document.getElementsByTagName("p");//该点击的节点for(原创 2016-01-10 00:21:08 · 1980 阅读 · 0 评论 -
array to object +javascript
var str = "[name:'john', inf:'no1']";var midarr = str.substring(1,str.length-1).split(',');//console.info('midarr',midarr);var toalobj =原创 2010-06-04 09:59:00 · 803 阅读 · 0 评论 -
js regex 身份证 手机号 验证
/^(13|14|15|18)[0-9]{9}$/.test("13000000000");"www.@163.com".match(/^[/w/./-]+@([/w/-]+/.)+[a-z]{2,4}$/ig);原创 2011-04-21 17:47:00 · 1640 阅读 · 0 评论 -
js innerHTML outerHTML innerText
<br /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta http-equiv="content-type" conten原创 2011-04-22 12:26:00 · 1326 阅读 · 0 评论 -
js+setInterval()两种方式
setInterval("",2000);setInterval(function(){xxx;},2000);原创 2011-03-02 08:37:00 · 477 阅读 · 0 评论 -
showModalDialog close and jump to
index.htmlpopup window原创 2010-09-09 15:13:00 · 640 阅读 · 0 评论 -
firefox+plugin+jre
//run the page in your Firefox, you can see you browser will install jre automatically原创 2010-06-25 14:20:00 · 480 阅读 · 0 评论 -
fetch a dom element style
function getStyle_complex(oElement){ var oStyle; if( window.getComputedStyle ) { if(oElement.tagName.toUpperCase()==="A"){ oStyle_hover = window.getComputedStyle(oElement,"hover"); }else{ oStyle = window.getComputedStyle(oElement,null);原创 2010-08-13 14:49:00 · 728 阅读 · 0 评论 -
js replace dom element in html
step 1.your dom elementsstep 2.new a js file name example.js. following is the simple codevar mydom = "here am i";document.writ(mydom);原创 2010-08-06 12:47:00 · 596 阅读 · 0 评论 -
array push pop shift unshift +javascript
>>> var arr = ['john', 'tom', 'sam', 'chichi'];>>> arr.push();//return arr.length;<br />4>>> arr["john", "tom", "sam", "chichi"]>>> arr.pop();//remove the last element from the arrayreturn the last element of the array;<br />"chichi">>> arr["john", "to原创 2010-06-04 10:07:00 · 519 阅读 · 0 评论 -
判断字符串是否是这样组成的,第一个必须是字母,后面可以是字母、数字、下划线,总长度为5-20
<br /><br />var c = /^[a-z|A-Z]{1}[/w|_]{4,19}/;<br />c.test(‘str’);<br />原创 2010-06-02 14:48:00 · 10524 阅读 · 2 评论 -
js this keyword
Finally a value is assigned for use with the this keyword. If the value assigned refers to an object then property accessors prefixed with the this keyword reference properties of that object. If the value assigned (internally) is null then the this原创 2010-07-16 09:55:00 · 5826 阅读 · 0 评论 -
我在myeclipse下找不到javax.script.*,请大虾帮忙!!!
具体类package other;import javax.script.*;import java.io.*;// Evaluate a file of JavaScript and print its resultpublic class RunScript { public static void main(String[] args) throws IOExc原创 2008-10-29 17:51:00 · 1890 阅读 · 0 评论