社区
C#
帖子详情
this.onTimeout为null的错误,请大家帮忙!
MagicStone2008
2008-01-17 03:53:29
用AjaxPro 2,调用方法后出现this.onTimeout为null的错误,是怎么回事?
...全文
37
2
打赏
收藏
this.onTimeout为null的错误,请大家帮忙!
用AjaxPro 2,调用方法后出现this.onTimeout为null的错误,是怎么回事?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
MagicStone2008
2008-01-18
打赏
举报
回复
怎么没有人帮我?
一个穷困潦倒的程序员
2008-01-17
打赏
举报
回复
up
var r = this.on
Timeout
(this.duration, this);解决方法
这版本的AjaxPro.net框架集解决了出现this.on
Timeout
is not a function的
错误
,也是经常出现的"缺少对象的
错误
",同时包括AjaxPro.dll,AjaxPro.2.dll,AjaxPro.JSON.dll, AjaxPro.JSON.2.dll
ASP.NET无刷新上传.rar
ASP.NET无刷新上传 很不错的多文件 带进度条的 无刷新上传 绝对好用~~~ <script> var QuickUpload = function(file, options) { this.file = $$(file); this._sending = false;//是否正在上传 this._timer =
null
;//定时器 this._iframe =
null
;//iframe对象 this._form =
null
;//form对象 this._inputs = {};//input对象 this._fFINISH =
null
;//完成执行函数 $$.extend(this, this._setOptions(options)); }; QuickUpload._counter = 1; QuickUpload.prototype = { //设置默认属性 _setOptions: function(options) { this.options = {//默认值 action: "",//设置action
timeout
: 0,//设置超时(秒为单位) parameter: {},//参数对象 onReady: function(){},//上传准备时执行 onFinish: function(){},//上传完成时执行 onStop: function(){},//上传停止时执行 on
Timeout
: function(){}//上传超时时执行 }; return $$.extend(this.options, options || {}); }, //上传文件 upload: function() { //停止上一次上传 this.stop(); //没有文件返回 if ( !this.file || !this.file.value ) return; //可能在onReady中修改相关属性所以放前面 this.onReady(); //设置iframe,form和表单控件 this._setIframe(); this._setForm(); this._setInput(); //设置超时 if ( this.
timeout
> 0 ) { this._timer = set
Timeout
( $$F.bind(this._
timeout
, this), this.
timeout
* 1000 ); } //开始上传 this._form.submit(); this._sending = true; }, //设置iframe _setIframe: function() { if ( !this._iframe ) { //创建iframe var iframename = "QUICKUPLOAD_" + QuickUpload._counter++, iframe = document.createElement( $$B.ie ? "
" : "iframe"); iframe.name = iframename; iframe.style.display = "none"; //记录完成程序方便移除 var finish = this._fFINISH = $$F.bind(this._finish, this); //iframe加载完后执行完成程序 if ( $$B.ie ) { iframe.attachEvent( "onload", finish ); } else { iframe.onload = $$B.opera ? function(){ this.onload = finish; } : finish; } //插入body var body = document.body; body.insertBefore( iframe, body.childNodes[0] ); this._iframe = iframe; } }, //设置form _setForm: function() { if ( !this._form ) { var form = document.createElement('form'), file = this.file; //设置属性 $$.extend(form, { target: this._iframe.name, method: "post", encoding: "multipart/form-data" }); //设置样式 $$D.setStyle(form, { padding: 0, margin: 0, border: 0, backgroundColor: "transparent", display: "inline" }); //提交前去掉form file.form && $$E.addEvent(file.form, "submit", $$F.bind(this.dispose, this)); //插入form file.parentNode.insertBefore(form, file).appendChild(file); this._form = form; } //action可能会修改 this._form.action = this.action; }, //设置input _setInput: function() { var form = this._form, oldInputs = this._inputs, newInputs = {}, name; //设置input for ( name in this.parameter ) { var input = form[name]; if ( !input ) { //如果没有对应input新建一个 input = document.createElement("input"); input.name = name; input.type = "hidden"; form.appendChild(input); } input.value = this.parameter[name]; //记录当前input newInputs[name] = input; //删除已有记录 delete oldInputs[name]; } //移除无用input for ( name in oldInputs ) { form.removeChild( oldInputs[name] ); } //保存当前input this._inputs = newInputs; }, //停止上传 stop: function() { if ( this._sending ) { this._sending = false; clear
Timeout
(this._timer); //重置iframe if ( $$B.opera ) {//opera通过设置src会有问题 this._removeIframe(); } else { this._iframe.src = ""; } this.onStop(); } }, //销毁程序 dispose: function() { this._sending = false; clear
Timeout
(this._timer); //清除iframe if ( $$B.firefox ) { set
Timeout
($$F.bind(this._removeIframe, this), 0); } else { this._removeIframe(); } //清除form this._removeForm(); //清除dom关联 this._inputs = this._fFINISH = this.file =
null
; }, //清除iframe _removeIframe: function() { if ( this._iframe ) { var iframe = this._iframe; $$B.ie ? iframe.detachEvent( "onload", this._fFINISH ) : ( iframe.onload =
null
); document.body.removeChild(iframe); this._iframe =
null
; } }, //清除form _removeForm: function() { if ( this._form ) { var form = this._form, parent = form.parentNode; if ( parent ) { parent.insertBefore(this.file, form); parent.removeChild(form); } this._form = this._inputs =
null
; } }, //超时函数 _
timeout
: function() { if ( this._sending ) { this._sending = false; this.stop(); this.on
Timeout
(); } }, //完成函数 _finish: function() { if ( this._sending ) { this._sending = false; this.onFinish(this._iframe); } } }
Creator数钱小游戏源码CountMoney.zip
Creator数钱小游戏源码CountMoney.zip // Learn cc.Class: // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html // Learn Attribute: // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html cc.Class({ extends: cc.Component, properties: { nodeMoney: cc.Node, nodeGuide: cc.Node, nodeStart: cc.Node, txtCount: cc.Label, txtTime: cc.Label, nodeMoneyBg: cc.Node, nodeTimerBg: cc.Node, nodeSpillMoney: cc.Node, txtTotal: cc.Label, }, // LIFE-CYCLE CALLBACKS: onLoad () { this.node.on(cc.Node.EventType.TOUCH_START, event => { this.onTouchStart(event); }); this.node.on(cc.Node.EventType.TOUCH_MOVE, event => { this.onTouchMove(event); }); this.node.on(cc.Node.EventType.TOUCH_END, event => { this.onTouchEnd(event); }); this.nodeMoneyBg.zIndex = 10; this.nodeTimerBg.zIndex = 10; this.nodeStart.zIndex = 20; this._touchNode =
null
; this._count = 0; this._isPlaying = false; }, start () { }, startGame(){ this._isPlaying = true; this.nodeStart.active = false; this.txtTime.string = 10; this.txtCount.string = 0; this._count = 0; this.startTimer(); this.spillMoney(); }, startTimer(){ this.schedule(this.timeCallback, 1); }, timeCallback(){ let time = parseInt(this.txtTime.string); time--; this.txtTime.string = time; if(time this._touchNode.y){ this._touchNode.y = pos.y; } }, onTouchEnd(event){ if(!this._isPlaying){ return; } let now = event.getLocation(); let start = event.getStartLocation(); if(now.y - start.y > 10){ let seq = cc.sequence( cc.spawn( cc.moveBy(0.3, 0, cc.winSize.height), cc.scaleTo(0.3, 0.7) ), cc.removeSelf(), ); this._touchNode.runAction(seq); } this._count++; this.txtCount.string = `${this._count * 100}`; }, onClick(){ this.startGame(); }, spillMoney(){ let seq = cc.sequence( cc.delayTime(0.2), cc.callFunc( () => { let x = Math.random() * cc.winSize.width; x -= cc.winSize.width / 2; let node = cc.instantiate(this.nodeSpillMoney); node.active = true; node.parent = this.nodeSpillMoney.parent; node.runAction(cc.sequence( cc.place(x, cc.winSize.height / 2 + node.height / 2), cc.spawn(cc.moveBy(1, 0, -cc.winSize.height - node.height / 2), cc.rotateBy(1, 1080)), cc.removeSelf(), )); }), ); seq.setTag(0xff); this.node.runAction(seq.repeatForever()); }, });
AjaxPro.2.dll 最新版 v9.2.17.1-46947
最新版本的AjaxPro,已修复var r = this.on
Timeout
(this.duration, this);行报错的bug。
ajaxPro 9.2.17.1
修改了this.on
Timeout
is not a function 的脚本错
C#
110,534
社区成员
642,575
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章