using jquery to post data in zend framework

后端 未结 2 715
终归单人心
终归单人心 2020-12-07 00:05

If you check it out I have a bit of a problem with the following, I have a form (webbooks.phtml) in which I use a jQuery function

http://pastebin.com/7Pbd43fC -webbo

2条回答
  •  温柔的废话
    2020-12-07 00:44

    If the result of your client-side call is just a redirect to another page, then why not do it all on a single controller/action/viewscript, as follows:

    1. Make the form submit a GET request rather than a POST
    2. Submit the form back to the same page, perform your remote API call, and render the results.

    Even if you want to do it in two actions - one to show the form, another to display the results - I don't see what value you are getting from the AJAX call.

    Am I missing some other requirement?

    Doing it with the current structure, you'd have to save the results of the remote API call into the session and then retrieve it after the redirect. Do-able, but it strikes me as unnecessary if it can be done in a single action.

提交回复
热议问题