Javascript关联数组速记在IE中不起作用

I'm using ajax to post to the server, with the following code:

$.post( "/api/server_login.php", { variable_1, variable_2 }, function( json ) {...

Where the array in the middle is short-form for:

$.post( "/api/server_login.php", { variable_1:variable_1, variable_2:variable_2 }, function( json ) {...

In other words, using the variable name as the key AND the variable contents as the value.

This short-form works in all browsers except Internet Explorer.

Did I make this short-form up, with it just happening to be working in all the other browsers? Or is this something I can fix in Internet Explorer somehow?

Tried looking for resources on this but couldn't find anyone else using this short-hand for associative arrays in Javascript!

查看全部
doukun8670
doukun8670
2017/01/22 17:42
  • Internet-explorer
  • php
  • arrays
  • javascript
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复