360 the browser compatibility mode cannot be $. Post (not a connection onclick problem !!)

Source: Internet
Author: User

 

Recently, I found that a 360 browser is very annoying, in compatibility mode.

Code:

<A href = "#" onclick = 'doaudit (1) '> review </a>

Clicking does not have any effect. I tried none of my browsers.

So I thought the compatibility mode would change to IE6.

So I changed it to a variety of writing methods.

<A href = "javascript: void (0)" onclick = 'doaudit (1); Return false; '> review </a>

And so on.

Later, I slowly calmed down, commented out the paragraph, and found that, relying on it, it turned out that after adding $. Post, a didn't respond.

Later, I found someone answered the question.

360 the Ajax return value will be cached. Add a timestamp to the URL and try again.

Therefore

 

The original code is as follows:

<A href = "#" onclick = doaudit (1) '> review </a>

<SCRIPT>

Function doaudit (ID ){
// Review
If (type = 1 ){
$. Post ("/ajaxapp/commonajaxquery. ashx", {A: "Audit", ID: Id}, function (data, textstatus ){
If (Data! = NULL ){

}
Else
Alert ("data error, please contact the Administrator ");
});
</SCRIPT>
In compatibility mode, click the connection, there is no reflection, and adding alert () above for debugging does not reflect any

Add a random timestamp (TS) to the end)

$. Post ("/ajaxapp/commonajaxquery. ashx", {A: "Audit", ID: ID, TS: Math. Random ()}

Now.

You can write it like this.

$. Post ("/ajaxapp/commonajaxquery. ashx? TS = "+ math. Random (), {A:" Audit ", ID: Id}

 

It took two hours to finally solve the problem perfectly.

 

360 the browser compatibility mode cannot be $. Post (not a connection onclick problem !!)

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.