Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8124427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:27:33+00:00 2026-06-06T06:27:33+00:00

I have the following code: $.ajax({ type: ‘GET’, url: ‘index.php?route=checkout/onepagecheckout/getpaypaldata’, dataType: ‘json’, success: function(json)

  • 0

I have the following code:

$.ajax({
      type: 'GET',
      url: 'index.php?route=checkout/onepagecheckout/getpaypaldata',
      dataType: 'json',
      success: function(json) {
                              $('#pp_info').html(json['output']);
                              $('#payment').submit();
                              }
      });

The ajax requests receives a json object containing a html form like :

<form id="payment" method="post" action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" value="_cart" name="cmd">
<input type="hidden" value="1" name="upload">
<input type="hidden" value="test@yahoo.ca" name="business">
<input type="hidden" value="Sample Item Name" name="item_name_1">
<input type="hidden" value="TESTI-1" name="item_number_1">
<input type="hidden" value="104.98" name="amount_1">
<input type="hidden" value="1" name="quantity_1">
<input type="hidden" value="0" name="weight_1">
<input type="hidden" value="Type" name="on0_1">
<input type="hidden" value="As Shown" name="os0_1">
<input type="hidden" value="Delivery Date" name="on1_1">
<input type="hidden" value="Jun 23,2012" name="os1_1">
<input type="hidden" value="Comments" name="on3_1">
<input type="hidden" value="test message" name="os3_1">
</form>

which contains the information that PayPal requires in order to process the order. Everything works fine except I believe sometimes the form gets submitted before the jQuery .html function is done with loading the html content.

Is there any callback function for .html ? or any other method that I can use to solve the issue ? the PayPal data comes as a HTML form and I can’t change that part, so I only have one option which is somehow load the html content and submit the form !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T06:27:34+00:00Added an answer on June 6, 2026 at 6:27 am

    You may try this

    success: function(json) {
        $('#pp_info').html(json['output']).promise().done(function(){
            $('#payment').submit();
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: $.ajax({type: 'get', mode: 'abort', dataType: 'json', url: 'http://localhost/1.php', data:
I have the following code: $.ajax({ type: 'GET', url: 'edit_slides.php', data: { user_id: user_id
I have the following code var test; $.ajax({ type: "GET", url: "../views/person/controller.php?actor=person&action=checkAge", data: "age="
I have the following js code: var ret; $.ajax({ type: 'GET', url: '/Pay/Build64/', dataType:
I have the following code $.ajax({type: GET, url: / + filename, dataType: xml, cache:
I have the following code: $(document).ready(function(){ $.ajax({ url: svc/GetTweetsByUser.php, type: POST, success: function(data) {
I have the following code: $.ajax({ type: GET, url: AJAX.ashx?job=fetch_calendar, dataType: html, success: function
I have the following code: var src, flickrImages = []; $.ajax({ type: GET, url:
I have following code $.ajax({ type: 'POST', url: 'index.jsp', data: 'id=111', dataType: 'jsonp', success:
I have the following code: $.ajax({ type: GET, url: /Search/GetNewData //Controller/ActionMethod ---snip--- )}; This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.