angularjs $http.delete breaks on ie8

后端 未结 3 1804
情深已故
情深已故 2021-02-19 04:24
$http.delete(\'/api/carts/\' + productCode).
  success(function() {
    cart.products = someMethod();

    updateTotals();
  }).
  error(function() {
    console.log(\'C         


        
3条回答
  •  执笔经年
    2021-02-19 05:26

    delete is the JavaScript reserved keyword, and IE parse it as a keyword. Here is the solution. http://tech.pro/tutorial/1238/angularjs-and-ie8-gotcha-http-delete

    Here is the javascript reserved keyword list

    http://www.w3schools.com/js/js_reserved.asp

    so its better to use $http['delete'] instead of $http.delete

提交回复
热议问题