[jQuery] window.location && submit Post Data


I was wondering how you go about using a simple link, clicking on it, submitting post data, but unlike ajax it would change the browser location aswell.


<script type="text/javascript">
        var data = {
name: "Their Name, gotten through other methods",
nextvar: "Other data"

<a href="#" name="edit">Edit</a>

After clicking on edit, it would then navigate to a specified url and send the post data so that they would be able to edit the info.

I would do this with a simple form if there was not 1 problem. These edit links are all generated, meaning there could be several on one page and it would be difficult to manage them that way.

~Cody Woolaver

I’m not sure what you are trying to do here.

If you want url to be different than one of submitted form, you can use ajax to submit your form, then on success event change document.location.href

Why not make a regular <form> and submit() it by the link? The form-accepting script can then print a new Location: header.