locked
XMLHttpRequest Object RRS feed

  • Question

  • User-462966914 posted

    Hi,

    The below code works on IE, Chrome etc but not with safari, 

    function Add_PRD()
    {
    
    if (window.XMLHttpRequest) { u = new XMLHttpRequest;} else { u = new ActiveXObject("Microsoft.XMLHTTP"); }
    
    u.onreadystatechange = function () {
    if (u.readyState == 4 && u.status == 200) { Assign_Values1(u.responseText); }
    }; u.open("GET", "Add_Product.aspx?Prd_ID=10", true);
    
    u.send();return false;
    }

    Please advise why this doesn't work with Safari?

    Thursday, March 30, 2017 5:58 PM

Answers

  • User-1838255255 posted

    Hi Locaso,

    According to your description, as far as I know, this maybe caused of the security policy of the safari, my suggestion is to debug your function in safari, check if meet some exception message in console panel or other place. Also I hope you could describe the how it doesn't work.

    About how to debug JS in safari, please try the following steps:

    open the preferences > advanced > show develop menu, and there you can view items such as "Start debugging javascript".

    Best Regards,

    Eric Du

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, March 31, 2017 5:00 AM