When using ecshop Ajax (that is, transport. JS)
IE sometimes appears:Referenceerror: process_request is not defined, FF appears:Transport. JS/run () error: UndefinedIn fact, this has nothing to do with transport. js. So where is the problem?
(1) first, find row 445-447 and find these two sentences:
/* Define two aliases */
VaR Ajax = transport;
Ajax. Call = transport. Run;
(2) then find "735" and find this sentence:
Ajax. OnRunning = showloader;
Haha... the problem lies in this sentence.ShowloaderFunction. Because this statement exists in the first row of the function.
If (! OBJ & process_request ),The above problem occurs, that is, the variableProcess_requestNo definition !!
(3) Why is this variable not defined?
The reason is very simple, because EC often uses this sentence:
<SCRIPT type = "text/javasOther ">
VaR process_request = "{$ Lang. process_request }";
.....
</SCRIPT>
Put it at the end of the article... when there are other processing tasks, JS loading, and JS running in the middle, the above error will certainly appear before it reaches the bottom !!!
Process_requestWhat is the use of this variable? In fact, it is to create a div layer to display the message "processing your request !! Why? This supports multiple languages.
Solution:
(1) InShowloaderAdd this sentence to the function body.VaR process_request = 'processing your request ...';In English, it is changed to English...
(2) ChangeVaR process_request = "{$ Lang. process_request }";This sentence is placed in the <SCRIPT> below
(3) Redefine Ajax. OnFor example, you can create a new function run, Ajax. On.Running = run
Method 2: for this problem, the Official Administrator replied that "Sometimes Ajax captures incomplete order information and such an error message appears, but this does not affect your normal use. Please rest assured. If you want to disable it, you can remove it from the basic settings of the store settings in the background .", In fact, according to the official statement, the problem still exists. The solution is to comment out the pop-up statement: Find JS/transport. JS, Row 3: Alert (this. filename + "/run () error:" + ex. description); copy the code to/* alert (this. filename + "/run () error:" + ex. description); */copy the code
Original article: http://hi.baidu.com/javaplan/blog/item/e785bb4bb5f034fe83025cd3.html