Can you send post parameters in window.location.href?

0

It is possible to send parameters post to window.location.href when clicking on a button send me to a new page with parameter post , I do not want to send it for get from url .

    
asked by Alldesign Web 02.10.2016 в 19:53
source

2 answers

1

Actually the window.location.href refers specifically to the address of the current page. The POST method is used as one of the methods of sending forms and can not be represented through a URL. The way to represent a form would be with the GET method. I recommend that you create a javascript form (document.createElement ('form')) and enter the values you want to send and use the submit function implicit in the forms.

    
answered by 04.11.2016 в 04:33
0

You can not send variables with windows.location.href, but as another option you can use jquery.redirct.js a very useful plugin just for what you are looking for, send post from javascript without needing a form, here I leave the documentation link

    
answered by 12.05.2017 в 20:25