window.open()在添加到主屏幕的移动Safari Web应用程序中不起作用

dal*_*len 8 javascript iphone web-applications

这是我尝试过的所有代码:

select:function(event, ui) {
    window.open(ui.item.value, "_blank");
}

select:function(event, ui) {
    window.location.href = ui.item.value;
}
Run Code Online (Sandbox Code Playgroud)

在Web应用程序模式下,屏幕只是刷新,它不会到达该位置.在Mobile Safari中,它按预期工作.

这是iPhone上的网络应用程序的限制吗?有办法解决吗?

这是完整的代码:

<script>
$(document).ready(function() {
    var cct = $('input[name=csrf_token]').val();    
    var searchInput = $('input[name=search]');

    function loadEventsData(onSuccess){
      $.ajax({
        type: 'POST',
        url: '<?php echo site_url('ajax_frontend/getEventsSearch'); ?>',
        dataType: 'json',
        success: onSuccess,
        error: function(XMLHttpRequest, textStatus, errorThrown) { alert(errorThrown); }
      });
    }

    function initializeEventsAutocomplete(data){
      searchInput.addClass('loaded').autocomplete({
      source:data,
      appendTo: '.search_autocomplete',
      minLength:2,
      delay:0,
      selectFirst:false,
      open: function(event, ui) {
        $('ul.events').hide();
        $('.ui-autocomplete').removeAttr('style');
        $('.icon-search').hide();
        $('.icon-close').show();
      },
      close: function(event, ui) {
        val = searchInput.val();
        searchInput.autocomplete("search", val);
        searchInput.focus();
        return false;
      },
      select:function(event, ui) {
        window.location.href = ui.item.value;
        return false;
      }
      });
    }

    $('form').submit(function(e) {
        e.preventDefault();
        searchInput.blur();
    });

    searchInput.keyup(function(){
    if($(this).is(".loaded")) return;
    loadEventsData(initializeEventsAutocomplete);
    });

    $('.icon-close').click(function(e) {
        e.preventDefault();

        $(this).hide();
        $('.icon-search').show();
        searchInput.autocomplete('close');
        $('ul.events').show();
        searchInput.val('');
    });
});
</script>
Run Code Online (Sandbox Code Playgroud)

这是JSON(其中一些):

[{"value":"http:\/\/events.dev\/index.php\/event\/canada-day","label":"Canada Day"},{"value":"http:\/\/events.dev\/index.php\/event\/triathlon-festival","label":"Triathlon Festival"}]
Run Code Online (Sandbox Code Playgroud)

dal*_*len 1

我明白了这一点。我使用以下代码来阻止 Web 应用程序中的链接在 Safari 中打开:

https://gist.github.com/1042026

这导致了一些不需要的副作用。为了解决这个问题,我添加了:

event.stopPropagation();

到我的selection:function地区,它应该正常工作。