jQuery - getJSON if data == success redirect to success page

0 votes
369 views
added Feb 9, 2018 in API by LC Marshal Captain (25,790 points)
edited Jul 13, 2018 by LC Marshal
$.getJSON(submitUrl,
    function(data) {
      if (data == 'success'){
        console.log("redirecting..");
        window.location.replace("report-success.html");
      }
    }
);
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...