js 关于this引起的错误
来源:互联网 发布:类似于快刀的软件 编辑:程序博客网 时间:2024/06/01 10:14
_savePayment: function () { var _this = this; //var params = $("#payment_partial input").serializeArray(); window.oscObserver.beforeUpdatePaymentMethod(); var params = $("#checkout_form").serializeArray(); params[params.length] = {'name': 'step', 'value': 'payment_method'}; this.queueProcess('save_payment',{ url: _this.options.saveStepUrl, type: 'POST', data: params, //async : false, beforeSend: function () { _this._loadWait('review_partial'); if (_this.options.payment.loading_shipping_method) _this._loadWait('shipping_partial'); }, complete: function (response) { try { var responseObject = $.parseJSON(response.responseText); } catch (ex) { _this._removeWait(); return false; } _this._updateHtml(responseObject); window.oscObserver.afterUpdatePaymentMethod(responseObject); } }); },
_create: function () { this._super(); var _this = this; var isCheckExistEmail = $("input[name='billing[create_new_account]']").is(":checked") || $("#billing\\:email").hasClass('check-email-exists'); if (isCheckExistEmail) { $("#billing\\:email").trigger('change'); } $("input[name='billing[create_new_account]']").on('change', function () { if ($(this).is(":checked")) { $("#billing\\:email").trigger('change'); } }); $("#billing\\:email").bind('change', function () { var isCheckExistEmail = $("input[name='billing[create_new_account]']").is(":checked") || $("#billing\\:email").hasClass('check-email-exists'); alert(isCheckExistEmail) if (!isCheckExistEmail) return; _this.queueProcess('check_email', { url: _this.options.billing.checkExistsUrl, type: 'POST', //async : false, data: {email: $("#billing\\:email").val()}, complete: function (response) { try { var responseObject = $.parseJSON(response.responseText); } catch (ex) { _this._removeWait(); return true; } if (responseObject && responseObject.success == false) { _this._removeWait(); _this._openConfirmExistEmail(); } } }); }); _this._onchangeBillingLocactionFields(); this.element .on('click', _this.options.billing.noUseForShippingAddressCheckboxId, function () { $(_this.options.shipping.countryDropdownSelector) && $(_this.options.shipping.countryDropdownSelector).trigger('change'); }) .on('change', this.options.billing.addressDropdownSelector, $.proxy(function (e) { this.element.find(this.options.billing.newAddressFormSelector).toggle(!$(e.target).val()); if ($(_this.options.billing.useForShippingAddressCheckboxId).is(':checked') || _this.options.billing.alwaysUseShippingAsBilling ) { _this._updateLocation(null, 'billing_shipping'); } else { _this._updateLocation(null, 'billing'); } }, this)) .find(this.options.billing.form).validation(); if (_this.options.autoDetectLocation) { try { this.autoDetectLocation(); } catch (e) { } } var that = this; /** * checkbox : is create new account */ if ($("input[name=\"billing[create_new_account]\"]").checked) $(that.options.checkout.registerCustomerPasswordSelector).show(); else $(that.options.checkout.registerCustomerPasswordSelector).hide(); $("input[name=\"billing[create_new_account]\"]").click(function () { if (this.checked) $(that.options.checkout.registerCustomerPasswordSelector).show(); else $(that.options.checkout.registerCustomerPasswordSelector).hide(); }); /** * checkbox address */ //shipping-area $("input[name=\"billing[use_for_shipping]\"]").change( function () { if ($("#billing\\:use_for_shipping_yes").length) { if ($("#billing\\:use_for_shipping_yes").is(":checked") == 1) { $("#shipping-area").hide(); } else { $("#shipping-area").show(); } } else { $("#shipping-area").hide(); } } ); $("input[name=\"billing[use_for_shipping]\"]").trigger('change'); return this; }
红色代码部分,第一个是对的,后一个原来和第一段代码是一样的,报错不是函数,改成现在的才对
0 0
- js 关于this引起的错误
- JS 语法引起的错误
- 关于js的this
- 一个逗号引起的JS错误
- 关于遨游等浏览器对浮动广告过滤引起的网页js错误
- Thinkphp: 关于文件格式引起运行的错误
- 关于Js的this问题
- 项目中js错误引起的MyEclipse的卡死
- 关于Eclipse的makefile引起的错误解决方案
- 关于ORACLE可能引起数字类型错误的原因之一
- 关于使用引用类型所引起的错误
- js 关于this的一些语法问题
- 关于js this 的一个难点
- {{JS}}关于this一个不解的地方
- 关于JS 函数this的用法
- 关于js中函数里的this
- 关于js中this的用法详解
- JS关于this的思考和总结
- stl源码剖析(一)空间配置器
- MySQL 5.7安装教程
- AudioEffect构造流程跟踪 & 音效库实现(native侧)
- java字符串转换
- 关于解决多选框选择后隐藏文本框内内容的方法;
- js 关于this引起的错误
- 求两个数的最大公约数
- Android布局优化技巧
- 学习设计模式-外观模式
- CentOS时间的查看与修改
- nandflash原理及硬件操作
- php八大设计模式之适配器模式
- .net code first 改为mysql数据库的步骤
- 根据系统时间来展示不同的页面