Ext-basex.js processing of synchronization requests in Firefox12, Google in the latest version is not supported (in the FIREFOX11 is supported) how to do? (answered) __js

Source: Internet
Author: User
Tags browser cache

Ext.Ajax.request sends a sync request---based on ext-basex

First download the Ext-basex script file from http://code.google.com/p/ext-basex/, after decompression, according to the instructions Readme file to refer to the EXT library and Ext-basex.

< link rel= "stylesheet" type= "Text/css" href= ". /lib/ext-3.0+/resources/css/ext-all.css "/>
< script type= "Text/javascript" src= ". /lib/ext-3.0+/adapter/ext/ext-base.js "></script>
< script type= "Text/javascript" src= ". /lib/ext-3.0+/ext-all[-debug].js "></script>
<script type= "Text/javascript" src= ". /lib/ux/ext-basex[-debug].js "></script>

Then use the Ext.Ajax.request method to add Async:false,//async Asynchronous (TRUE asynchronous, False Sync), and other parameters unchanged.

Ext.Ajax.request ({
URL: "Streamingproxy.ashx",
Method: ' Get ',
Async:false,//async Asynchronous (TRUE asynchronous, False sync)
Success:function (response, opts) {
},//Request a successful callback function
Failure:function () {alert (' Get directory request failed. "); } callback function with request failed
});

Note: After doing the above operation in IE, Google Chrome, firefox11 is no problem, but to firefox12 go down to see, the implementation of this time has been carried out is failure, that is to go to the failure.

Ext.Ajax.request ({
URL: ' Uservalidate ',
Method: ' Post ',
Params: {
Type: ' Checksession '
},
Async:false,//Async asynchronous (True asynchronous, False sync)
Success:function (response, opts) {
Alert (' Response.responsetext: ' +response.responsetext);
var val = Ext.util.JSON.decode (Response.responsetext);
if (val.nosession) {
Window.location.href = "index.html";
Return
}
},
Failure:function (response,options) {
Alert (' 4444444444444444444444444 ');
Alert (' Failure response.responsetext: ' +response.responsetext);
Window.location.href = "index.html";
Return
}
});

If you add "async:false,//Async asynchronous (True asynchronous, False sync)" In Firefox can not execute EXt.ajax.request request, that is, the old run to failure, this synchronization is to add Ext-basex.js.

Solution:

To modify a statement in the Ext-basex-debug.js file:

The following code: [JavaScript] View plain copy if (callback && callback.timeout) {[JavaScript] view plain copy if (callback && callback.timeout) {

instead: [JavaScript] View plain copy if (callback && callback.timeout && options.async) {[JavaScript] view P Lain Copy if (callback && callback.timeout && options.async) {

As you can see, "&& Options.async" has been added.

It's OK to change the place above.

If you are not using the debug version and you are using a compressed edition, look for "if (u&&u.timeout) {" (note no quotes) in Ext-basex.js, and then change it to "if" (u&&u.timeout &&n.async) {", of course, you can replace it directly."

Conclusion:

Change ' if (u&&u.timeout) {' To ' if (u&&u.timeout&&n.async) {'.

Note: The test must first clean up the cache, I tried to have no effect, and then found that the reason for caching.

How to clean browser cache [various browsers]

http://blog.csdn.net/e_wsq/article/details/7521468

Others said to change another place, but I did not try, above is I tried no problem.

In Ext-basex.js 4.1 about line 1011
(' timeout ' in R) && (r.timeout = callback.timeout);
Modified to:
(Options.async) && (' timeout ' in R) && (r.timeout = callback.timeout);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.