mardi 23 juin 2015

In tablet target = _blank is not working while submitting from in ember.js

In Ember.js, i am trying to submit a form with some post parameters and the resultant page should be open in new tab, In desktop its working fine but in tablet its opening in the same window. I am attaching the piece of code

 submitForm: function(method, actionUrl, target, names, values) {
  var form = document.createElement('form');
  var element;
  var i;
  form.method = method;  //Post
  form.action = actionUrl; 
  form.target = target;  // target = _blank
  form.style.visibility = "hidden";

  for (i = 0; i < names.length; i++) {
    element = document.createElement('INPUT');
    element.name = names[i];
    element.value = values[i];
    form.appendChild(element);
  }
  document.body.appendChild(form);

  form.submit();
}

Can anyone help me to achieve this

Thanks in advance




Aucun commentaire:

Enregistrer un commentaire