Getting value GET OR POST variable using JavaScript?

前端 未结 9 1574
一个人的身影
一个人的身影 2020-11-27 05:59

How to get value of the get or post variable on page load using JavaScript?

9条回答
  •  春和景丽
    2020-11-27 06:46

    You can only get the URI arguments with JavaScript.

    // get query arguments
    var $_GET = {},
        args = location.search.substr(1).split(/&/);
    for (var i=0; i

提交回复
热议问题