Visokio website     Downloads     Video tutorials     KnowledgeBase  
Content View: Scripting - Alert and confirm windows? - Visokio Forums
Content View: Scripting - Alert and confirm windows?
  •     Bart April 23, 2013 5:55AM
    Hello guys,

    I can get prompt window in Content View, why I can't get any alert or confirm windows?
  • 4 Comments
  •     Bart April 23, 2013 11:09AM
    Just a quick example , when I put this (bear in mind that this window is not showing full html code) :





    function y() {

    var y=window.prompt("please enter your name")
    var textf=document.getElementById("textf");
    textf.innerHTML=y;
    }







    I am getting window and also I am displaying name which I am putting in ,
    but when I do :





    var x=window.confirm("Are you sure you want to quit ??")
    if (x)
    window.alert("Thank you.")
    else
    window.alert("Good choice.")





    Nothing happens
  •     michael April 23, 2013 12:14PM
    Hi Bart,

    We disabled alert messages as it creates some issues with embedded IE browser.
    Please use just HTML DOM elements to show your messages, see attached example how you can show a message dialogue in JS.

    <html>
    <head></head>
    <script>
    function showAlert(message) {
    document.getElementById("message").innerText = message;
    document.getElementById("messageHolder").style.display = "block";
    }
    function hideAlert() {
    document.getElementById("messageHolder").style.display = "none";
    }


    </script>

    <body>



    <div id="messageHolder" style="position:absolute; display:none; top:50%; left:50%; width:200px; height:100px; background-color:red; border:1px solid blue;">
    <div id="message"></div>
    <input type=button onclick="hideAlert();" value="ok" style="position:absolute; left:50%; bottom:0">
    </div>


    <p style="margin-top: 0" align="left">
    <input id="inputText" type="text" value="Hello World!">
    <input type=button onclick="showAlert(document.getElementById('inputText').value);" value="Show alert!" >
    </p>


    <p style="margin-top: 0" align="left">
    &#160; Some content
    </p>


    </body>
    </html>
    Attachments
    browser JS alerts.iok 10K
  •     Bart April 24, 2013 11:31AM
    Thanks Michael,

    and what about confirm window? Have you disabled it for the same reason ?
    Is there a way to go around it ?
  •     michael April 25, 2013 4:55AM
    All "native/system" dialogue windows such as alert and confirm create some issues with embedded IE in Omniscope. So you shouldn't use them. If you are always in the internet you can use jQueryUI http://jqueryui.com/dialog/#modal-confirmation, http://jqueryui.com/dialog/#modal-message, etc . Or you can write something like this yourself using the example from the previous post.

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership