window.open在firefox

时间:2016-02-02 14:03:06

标签: javascript jquery html firefox

我有这样的表格:

<form id="platba">
             <label class="c-input c-radio">
              <input id="radio1" name="radio" type="radio" value="https://www.paypal.com/uk/webapps/mpp/home">
              <span class="c-indicator"></span>
              <img src="img/payments/paypal.png" width="80" style="margin-top:-5px">&nbsp Paypal
            </label>
             <br />
             <br />
            <label class="c-input c-radio">
              <input id="radio2" name="radio" type="radio" value="http://www.mbank.cz/osobni/">
              <span class="c-indicator"></span>
              <img src="img/payments/mbank.png" width="80" style="margin-top:-5px">&nbsp mBank
            </label>
             <br />
             <br />
            <label class="c-input c-radio">
              <input id="radio2" name="radio" type="radio" value="http://example.com/platebnikarta">
              <span class="c-indicator"></span>
              <img src="img/payments/visa_mastercard.png" width="80" style="margin-top:-5px">&nbsp Platební karta
            </label>
            <hr>            

            <button type="submit" class="btn btn-primary">Pokračovat v placení</button>
</form>

在文件的末尾我有javascript根据单选按钮选择打开新窗口:

$(document).ready(function(){
      $("#platba").submit(function(){
        event.preventDefault();
        var loc = $('input[name="radio"]:checked').val();
        window.open(loc,'_blank');
        //self.close ();
      });

    });

它在Google Chrome和IE中运行良好,但在Firefox中它只是将单选按钮的值添加到地址栏中。 例如:

http://something/something/something/something.php?radio=https%3A%2F%2Fwww.paypal.com%2Fuk%2Fwebapps%2Fmpp%2Fhome

1 个答案:

答案 0 :(得分:2)

InverseProperty中的public class Item { public int Id {get; set; } public string ItemId { get; set; } public virtual List<Detail> Details { get; set;} } public class Detail { public int DetailId { get; set; } public string ItemId { get; set; } [InverseProperty("ItemId")] //NB EF will look in the principal for this //i.e. the Item class public virtual Item Item { get; set; } } 未定义。您必须在您调用它的函数中定义它:

event

以下是您在Firefox中运行的更正代码(在jsfiddle上自行测试):https://jsfiddle.net/duzwo5bk/7/

这是代码。 注意:它不能在这里工作,因为你无法在StackOverflow上的这些片段中弹出窗口

我还修复了你的第三台收音机的ID:)

&#13;
&#13;
event.preventDefault
&#13;
$("#platba").submit(function(event) {
  event.preventDefault();
});
&#13;
&#13;
&#13;