Use Ajax JSON (Getjson) to read data from the server, do not update the problem resolution under IE

Source: Internet
Author: User

Use Ajax JSON (Getjson) to read data from the server, do not update the problem resolution under IE

Because Getjson will take the target URL from IE cache in IE browser, the loop execution Getjson function will not get the latest data, if you add a time parameter to the target URL, then each execution will get a different URL to fetch the actual data.

<script language= "JavaScript" >
function GetData ()
{
var timeparam = Math.Round (new Date (). GetTime ()/1000);

Add millisecond time parameters to ensure that different URLs are taken each time
var url= "getjson.php?timenow=" + timeparam;
$.getjson (URL, function (data) {
alert (data.randdata); Take the value of the object
});
}

</script>

Use Ajax JSON (Getjson) to read data from the server, do not update the problem resolution under IE

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.