transport.js/run() error:'process_request' 未定义
在使用ECshop的AJAX(即:transport.js)
IE有时候会出现:ReferenceError: process_request is not defined,FF则出现:transport.js/run() error:undefined,其实这完全和transport.js无关。那么问题出在哪里呢?
(1)首先找到445-447行发现了这两句:
/* 定义两个别名 */
var Ajax = Transport;
Ajax.call = Transport.run;
(2)然后再找到735发现了这句:
Ajax.onRunning = showLoader;
哈哈….其实问题就是出在这句的showLoader函数里面。因为在该函数里753行有这段语句
if ( ! obj && process_request),而出现上述问题就是说变量process_request没有定义!!
(3)为什么说该变量没有定义呢?
原因很简单,因为EC很多时候都是将这句话:
…..
放在最后面的….在中途有其他什么处理、JS载入、JS运行而还没运行到最下面的时候当然就出现在上述的错误!!!
process_request这个变量到底有什么用呢?其实就是为了创建一个DIV层显示“正在处理您的请求…”这个信息!!为什么要这样实现呢?因为这样可以支持多语言。
解决办法:
(1)在showLoader函数体里面加入这句var process_request = '正在处理您的请求…';英文的话就改成英文了。。。
(2)将var process_request = "{$lang.process_request}";这句话放在
(3)重新定义Ajax.onRunning这一事件例如可以自己新建一个函数run,Ajax.onRunning = run
第二种方法:对于这个问题,官方管理员的回复是”有时ajax抓取订单信息不全,出现这样的错误信息,但这个不会影响您的正常使用,请您放心。如果要关闭,可以在后台里的商店设置 基本设置中去除。”,实际上,按照官方这个说法,问题还是照样存在,解决的办法是“眼不见,心不烦”,将这条弹出语句注释掉: 找到js/transport.js,第227行: alert(this.filename + "/run() error:" + ex.description); 复制代码将之改为: /* alert(this.filename + "/run() error:" + ex.description); */
摘自 顺子网络

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools
