0

实际上,我已将配置文件放在文件夹“ CerProv ”的根目录中'CerProv/deviceprofile.mobileprovision'。现在我试图通过像这样通过javascript执行它来安装它:

window.open("CerProv/deviceprofile.mobileprovision");

每当执行上述代码行时,浏览器窗口就会消失,并且会打开配置文件安装窗口。然后我单击“安装”按钮并开始安装配置文件。到这里它工作得很好。但现在我想要的是,在完成安装配置文件后,浏览器窗口应该会自动出现....

这是示例:在 ios 设备上打开此 url http://m.freemyapps.com/ios_enrollment/new

我想要与上述网址相同的功能。

是否有任何解决方案...任何形式的帮助将不胜感激。我非常需要这个。

4

1 回答 1

0

解决方案是使用“pageshow”事件。这是完整的 HAML 解决方案

.modal.fade
  .modal-header
    %h1 Sync XXX to your iPhone
  .modal-body
    %p Some explanation
  .modal-footer
    = link_to "OK", apple_sync_profile_user_url, class: 'btn btn-primary add-profile'

- content_for :bottom do
  :javascript
    var clicked = false;

    $('.add-profile').click(function() {
      clicked = true;
    });

    var redirect = function () {
      if(clicked)
        window.location = 'CerProv/deviceprofile.mobileprovision';
    };

    window.addEventListener('pageshow', redirect, false);
    $('.modal').modal({backdrop: 'static', keyboard: true})

编辑

对 Dimpal 代码的改编:

//on the click of a button
$('#popup .enroll').click(function(){
$('#popup').hide('100');
$('#wrapper1').css('opacity','1');
$('#wrapper1 a').attr('onclick','return true');
// after hitting the following url the browser window disappears and profile installation window of ios device will open....
window.open("CerProv/taxiopen-1.mobileprovision");
//now whenever the profile installation on ios device will be completed i want the current browser window to be opened automatically and start execution from the just next line automatically i.e. it should redirect on this url
window.addEventListener('pageshow', function() {window.open("getstarted.html");});

});
于 2013-06-17T00:41:18.557 回答