漫漫技术人生路

C#

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

随笔分类 -  经测试可以运行的javascript 起步

1 2 下一页

摘要:无标题文档 sfdf 阅读全文
posted @ 2008-09-26 17:37 javaca88

摘要:function Person(name,age){ //定义一个类,人类 this.name=name //名字 this.age=age //年龄 this.sayhello=function(){alert("hello")}} function Print(){ //显示类的属性 this.funcName="Pri... 阅读全文
posted @ 2006-12-15 09:47 javaca88

摘要:/* 在ie中,事件对象是作为一个全局变量来保存和维护的。 所有的浏览器事件,不管是用户触发的,还是其他事件, 都会更新window.event 对象。 所以在代码中,只要轻松调用 window.event就可以轻松获取 事件对象, 再 event.srcElement 就可以取得触发事件的元素进行进一步处理 在ff中, 事件对象却不是全局对象,一般情况下,是现场发生,现场使用,ff把事件对象自动... 阅读全文
posted @ 2006-12-15 09:10 javaca88

摘要:先看一个最简单的应用。在下面的代码中,我们需要实现一个功能,就是点击每个按钮显示相应的网址 那么。怎么写这个 showUrl函数呢? 我想大多数人可能会这样写. 这样些不太好,原因有二:1.写太长,很麻烦,用if, switch 语句来写,如果有100个条件,那岂不要写100个语句2.不便于维护和扩展,如果需求经常变化,那些数据从数据库来怎么办,没变一下都要改程序的逻辑结构对JavaScript比... 阅读全文
posted @ 2006-12-14 16:52 javaca88

摘要:function gggg(){ // gf.style.background-color = "red"; } function change(){var x = window.event.srcElement var y = x.parentNodey.style.backgroundColor = "red"}function change2(){var x = w... 阅读全文
posted @ 2006-12-13 17:05 javaca88

摘要:function g(f){ //if(typeof(f) =='undefined')throw('You must enter an age'); //错误是不能被捕获的因为这个位置处于构造函数阶段类的实例化阶段 this.tt =f;} g.prototype.h=function() { try { alert(t... 阅读全文
posted @ 2006-12-11 17:03 javaca88

摘要:// JScript 文件 var xmlHttp; function createXMLHttpRequest(){ if(window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if(window.XMLHttpRequest) ... 阅读全文
posted @ 2006-12-10 17:05 javaca88

摘要:function student(name){ this.name = name; this.study = function(){alert(this.name+"bad");};} //student.prototype ={study:function(){alert(this.name+"bad");}}//student.prototype.study =function(){ al... 阅读全文
posted @ 2006-12-09 15:54 javaca88

摘要:var winstr="";winstr += "请注意查看提醒";winstr+="";winstr+=""+msgstr+"";oPopup.document.body.innerHTML = winstr; js这东西是个宝,真的是不学不行了.最近也在一些项目中有意的用一用它,真的挺不错,就是太容易出错,稍有不慎就会在浏览器中看到 "!" . 今天用window.createPo... 阅读全文
posted @ 2006-12-08 14:20 javaca88

摘要:继续学习javascript delegate object // JScript 文件 object =new Object(); object.a="33";object["c"]="44";object.GetTotal=function(){alert(this.a+this.b);}; function gg()//在这里实现调用{ object.GetTotal(); myA... 阅读全文
posted @ 2006-12-07 16:47 javaca88

摘要:http://www.codeproject.com/jscript/http://www.codeproject.com/aspnet/ProMatrixUnplugged3.aspConcepts of OO JavaScript with ASP.NETMany people don't know that JavaScript can be used in an object orient... 阅读全文
posted @ 2006-12-06 16:10 javaca88

该文被密码保护。
posted @ 2006-12-06 14:01 javaca88

摘要:fdasfassf 阅读全文
posted @ 2006-12-06 10:34 javaca88

摘要:function newO() { window.open("Default.aspx?name='rtyt'",''); }function requestString(val){ var q= unescape(location.search.substr(1)).split('&');//frist split for(var i=0;ivar newWind... 阅读全文
posted @ 2006-12-06 10:30 javaca88

摘要:function InitArray() { var spreadsheet = [['A1', 'B1', 'C1', 'D1'], ['A2', 'B2', 'C2', 'D2'], ['A3', 'B3', 'C3', 'D3'], ['A4', 'B4', 'C4', 'D4']]; var col2 = spreadsheet[1] 阅读全文
posted @ 2006-12-06 10:02 javaca88

摘要:One of the more interesting aspects about JavaScript is the idea that functions are objects and can be passed around like an input box, image or anything else you may have. Take a look at this code, f... 阅读全文
posted @ 2006-12-06 09:30 javaca88

摘要:http://www.htmlgoodies.com/primers/jsp/function counting1(){ var count = 0; count++; alert(count);} var count = 0;function counting2(){ count++; alert(count);}function validateForm... 阅读全文
posted @ 2006-12-05 16:46 javaca88

摘要:http://www.htmlgoodies.com/primers/jsp/var apples = 5; function eatApples(){ alert('There are currently ' + apples + ' apples!'); var eat = prompt('How many apples would you like to eat?', '1')... 阅读全文
posted @ 2006-12-05 16:40 javaca88

摘要:var inputs = 0;function addContact(){ var table = document.getElementById('contacts'); var tr = document.createElement('TR'); var td1 = document.createElement('TD'); var td2 = document.cre... 阅读全文
posted @ 2006-12-05 16:30 javaca88

摘要:控制面板----Internet选项----高级---浏览类别清除禁用脚本调试设置短点 无标题页 fdsafasfasdfasddas111111111111111111111111111111111111111111111 一些三角形的写法 body { } html>form #p{ ba... 阅读全文
posted @ 2006-12-05 16:13 javaca88

1 2 下一页