Getting value GET OR POST variable using JavaScript?

前端 未结 9 1594
一个人的身影
一个人的身影 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:48

    You can't get the value of POST variables using Javascript, although you can insert it in the document when you process the request on the server.

    
    

    GET variables are available through the window.location.href, and some frameworks even have methods ready to parse them.

提交回复
热议问题