When using the following code on ionic 2 framework, everything works great on Android
but when I converted it into iOS
only the following bit of code doesn't work. I have been trying for past 2 days.
Please if someone can have a look and advise what's going on.
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
constructor(public navCtrl: NavController) {}
proceedToPayment(){
var mapForm = document.createElement("form");
mapForm.target = "_blank";
mapForm.method = "POST";
mapForm.action = "http://www.example.com/api/checkout.php";
// Create an input
var firstname = document.createElement("input");
var lastname = document.createElement("input");
firstname.type = "text"; firstname.name = "firstname"; firstname.value = "John";
lastname.type = "text"; lastname.name = "lastname"; lastname.value = "Doe";
// Add the input to the form
mapForm.appendChild( firstname );
mapForm.appendChild( lastname );
document.body.appendChild(mapForm);
mapForm.submit();
}
}