0

// webscript ActualCordova navigateur In-App ouverture des scripts externes

<script type="text/javascript"> 
    var lhnAccountN = "310904-1"; 
    var lhnButtonN = 38; 
    var lhnInviteEnabled = 1; 
    var lhnWindowN = 0; 
    var lhnDepartmentN = 36316; 
    var lhnChatPosition = 'bottomright'; 
</script> 

<a href="http://www.livehelpnow.net/products/live-chat-system" target="_blank" style="font-size:10px;" id="lhnHelp">best live chat</a> 

<script src="//www.livehelpnow.net/lhn/widgets/chatbutton/lhnchatbutton-current.min.js" type="text/javascript" id="lhnscript"></script> 

// les données stocke sur session. chaque fois que la connexion est perdue.

// donc j'utilise le navigateur intégré pour ouvrir le script dans l'application mobile ionique. Je suis incapable d'ouvrir la fenêtre s'il vous plaît, aidez-moi

$rootScope.testChat=function(){ 
    var options = { 
     location: 'no', 
     clearcache: 'yes', 
     toolbar: 'yes' 
    }; 

     var ref=window.open('http://www.livehelpnow.net/products/live-chat-system', '_blank', options); 

     ref.addEventListener('loadstop', function() { 
     ref.executeScript({ 
     code:"var lhnAccountN = '310904-1';var lhnButtonN = 38;var lhnInviteEnabled = 1;var lhnWindowN = 0;var lhnDepartmentN = 36316;var lhnChatPosition = 'bottomright';" 
    }) 
    ref.executeScript({ 
     code:"var chat; chat.src='www.livehelpnow.net/lhn/widgets/chatbutton/lhnchatbutton-current.min.js' chat.id='lhnscript'" 
    }) 
}) 
} 
<a href="http://www.livehelpnow.net/products/live-chat-system" target="_blank" style="font-size:10px;"ng-click="testChat()" id="lhnHelp">best live chat</a> 

Répondre

0

Remplacer la fonction window.open() avec cordova.InAppBrowser.open(). Vous pouvez consulter https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/index.html pour plus d'informations.

+0

Bonjour, nous ne pouvons pas charger le script. le navigateur intégré fonctionne très bien. La fenêtre est ouverte. – Harish98

+0

@HarishKesari essayez d'écrire tout le script dans un fichier js, puis essayez de charger le script. Utilisez inspecter le périphérique pour rechercher toute erreur pouvant survenir lors de l'exécution. –