1

In my website, after the user logs in, and a successful login response follows as a result of ajax login request, I want the user to be redirected to a 'appusers/appusers', such that the request sent to the server side module 'appusers' is a post request with some params like limit, offset etc. How do I accomplish this with jquery on the client side?

2 Answers 2

6

You can fill in fields of a POST form dynamically and trigger the submit() button and it will go to the action page set.

<form action="appusers/appusers" method="POST"> <input id="limit" type="hidden" value="" name="limit" /> </form> 

In the success function of the AJAX call,

$('#limit').val('My Limit'); $(form).submit(); 
Sign up to request clarification or add additional context in comments.

Comments

0

You can make an ajax call for your login request like this for example:

 $.ajax({ url: getSvcUrl(service, method), type: "GET", data: request, dataType: "json", contentType: "application/json; charset=utf-8", async: isAsync, success: redirectToPage(); , ... 

and in the redirectToPage() function called onSuccess you can do a window.location="http://www.bing.com" or a location.replace("http://www.microsoft.com") for a GET or submit a form for a POST ($("#myForm").submit())

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.