Open URL while passing POST data with jQuery

Active3 hr before
Viewed126 times

4 Answers


Request the test,php page and send some additional data along (while still ignoring the return results)

Example_snippet/controller/utility/_jquery.js/ $.ajax({ type: "POST", url: . . .
   type: "POST",
   url: url,
   data: data,
   success: success,
   dataType: dataType
load more v

If you mean that you want to change the current page URL, well then you can add a new <form> to the current page, add hidden input elements to it, and then submit it,,This seems like an unlikely situation, maybe you could comment with more details about the data being passed and its relation to the content of Page2?,If you are POSTing data not in a form (because you could simply set the form's action to the current page) and the data being posted isn't directly related to the content of the next page, you can use the callback function of jQuery's

Example_snippet/controller/utility/_jquery.js/ $('body').append($('<form/>') . . .
  .attr({'action': yourNewURL, 'method': 'post', 'id': 'replacer'})
    .attr({'type': 'hidden', 'name': 'param1', 'value': "hello"})
    .attr({'type': 'hidden', 'name': 'param2', 'value': "world"})
load more v

data: json data to be sent to the server with request as a form data, ,url: request url from which you want to submit & retrieve the data

Example_snippet/controller/utility/_jquery.js/ $.post(url,[data],[callback],[. . .
$.post(url, [data], [callback], [type]);
load more v

Search Answer Titles

Example_snippet/controller/utility/_model.js/ $.post(url, function (data) { . . .
$.post(url, function(data) {
   var w ='about:blank');;