Note that there are some explanatory texts on larger screens.

plurals
  1. POInserting an IFrame in a DIV with an Ajax response
    text
    copied!<p>I have a web site and I need that my users are able to make a payment and the web has it own page where its divided into 3 sections. The first one is for choosing the payment method(Visa, Mastercard, etc...) the second one is an inputbox where the user enters the amount to transfer and a button to proceed with the load of the Moneybookers payment gateway. Well, In the third section there is an empty DIV waiting for load until the user click on the transaction button. So, once this is done, I call a PHP via AJAX. The code of the AJAX function is the next one:</p> <pre><code> var xml = null; try{ xml = new ActiveXObject("Microsoft.XMLHTTP"); }catch(expeption){ xml = new XMLHttpRequest(); }xml.open("POST", "mb_connect.php", false); xml.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xml.send("pay_to_email="+datos[3]+"&amp;transaction_id="+datos[1]+ "&amp;status_url="+datos[2]+ "&amp;language="+lang+ "&amp;pay_from_email="+datos[13]+ "&amp;firstname="+datos[5]+ "&amp;lastname="+datos[6]+ "&amp;address="+datos[7]+ "&amp;postal_code="+datos[8]+ "&amp;city="+datos[9]+ "&amp;state="+datos[10]+ "&amp;country="+datos[11]+ "&amp;date_of_birth="+datos[12]+ "&amp;amount="+document.payment.cantidad.value+ "&amp;payment_methods="+datos[4]); $("#contenido").html(xml.responseText); </code></pre> <p>and the PHP called is this one:</p> <pre><code> &lt;?php header('Content-type: text/html; Charset=utf-8'); extract($_POST); $status_url2 = 'mailto:payments@misite.com'; $return_url_target = 3; $return_url = 'https://www.misite.com'; $cancel_url = 'https://www.misite.com'; ?&gt; &lt;iframe id="myiframe" name="myiframe" frameborder="no" style="height: 600px; width:735px;" scrolling = "auto"&gt; &lt;/iframe&gt; &lt;form name="oc" action="https://www.moneybookers.com/app/payment.pl" method="post" target="myiframe"&gt; &lt;input type="hidden" name="pay_to_email" value="&lt;?= $pay_to_email ?&gt;"&gt; &lt;input type="hidden" name="recipient_description" value="My SITE ltd"&gt; &lt;input type="hidden" name="transaction_id" value="&lt;?= $transaction_id ?&gt;"&gt; &lt;input type="hidden" name="status_url" value="&lt;?= $status_url ?&gt;"&gt; &lt;input type="hidden" name="status_url2" value="&lt;?= $status_url2 ?&gt;"&gt; &lt;input type="hidden" name="return_url_target" value="&lt;?= $return_url_target ?&gt;"&gt; &lt;input type="hidden" name="return_url" value="&lt;?= $return_url ?&gt;"&gt; &lt;input type="hidden" name="cancel_url" value="&lt;?= $cancel_url ?&gt;"&gt; &lt;input type="hidden" name="return_url_target" value="1"&gt; &lt;input type="hidden" name="cancel_url_target" value="1"&gt; &lt;input type="hidden" name="language" value="&lt;?= $language ?&gt;"&gt; &lt;input type="hidden" name="confirmation_note" value=""&gt; &lt;input type="hidden" name="pay_from_email" value="&lt;?= $pay_from_email ?&gt;"&gt; &lt;input type="hidden" name="title" value=""&gt; &lt;input type="hidden" name="firstname" value="&lt;?= $firstname ?&gt;"&gt; &lt;input type="hidden" name="lastname" value="&lt;?= $lastname ?&gt;"&gt; &lt;input type="hidden" name="address" value="&lt;?= $address ?&gt;"&gt; &lt;input type="hidden" name="postal_code" value="&lt;?= $postal_code ?&gt;"&gt; &lt;input type="hidden" name="city" value="&lt;?= $city ?&gt;"&gt; &lt;input type="hidden" name="state" value="&lt;?= $state ?&gt;"&gt; &lt;input type="hidden" name="country" value="&lt;?= $country ?&gt;"&gt; &lt;input type="hidden" name="date_of_birth" value="&lt;?= $date_of_birth ?&gt;"&gt; &lt;input type="hidden" name="amount" value="&lt;?= $amount ?&gt;"&gt; &lt;input type="hidden" name="currency" value="EUR"&gt; &lt;input type="hidden" name="rec_cycle" value="day"&gt; &lt;input type="hidden" name="payment_methods" value="&lt;?= $payment_methods ?&gt;"&gt; &lt;input type="hidden" name="submit_id" value="Submit"&gt; &lt;/form&gt; &lt;script language="JavaScript"&gt;document.oc.submit();&lt;/script&gt; </code></pre> <p>so, this script, when executed, call automatically the moneybookers payment gateway and return the HTML code that is inserted into the IFRAME.</p> <p>Well, all this process work fine in all browsers except Internet Explorer. There is no error and the DIV is empty.</p> <p>Does anyone know what could be the mistake?</p> <p>I would appreciate any help.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload