locked
JavaScript not work in visual studio.. RRS feed

  • Question

  • In visual studio tools for apache corodova when try to execute any javascript there is not showing any result in ripple but my code is ok there is no error..

    show this messege..

    code:-32000
    message:Debugger agent is not enabled
    The program '[1] http://localhost:4400/index.html?enableripple=cordova-3.0.0-NexusGalaxy: WebKit' has exited with code -1 (0xffffffff).

    my code is ...

    <!DOCTYPE html>
    <html>
    <head>
    <style> 
    #myDIV {
        width: 100px;
        height: 100px;
        background: red;
        ;
       
    }

    /* Chrome, Safari, Opera */
    @-webkit-keyframes mymove {
        from {}
        to {}
    }

    /* Chrome, Safari, Opera */
    @-webkit-keyframes mynewmove {
        from {}
        to {}
    }

    @keyframes mymove {
        from {}
        to {}
    }

    @keyframes mynewmove {
        from {}
        to {}
    }
    </style>
    </head>
    <body>

    <button onclick="myFunction()">Try it</button>

    <div id="myDIV"></div>

    <script>
    function myFunction() {
        document.getElementById("myDIV").style.WebkitAnimation = "mynewmove 4s 2"; // Code for Chrome, Safari and Opera
        document.getElementById("myDIV").style.animation = "mynewmove 4s 2";
    }
    </script>

    </body>
    </html>

    plz help me anyone to solve this issue..

    Monday, December 14, 2015 11:23 AM

All replies

  • I want to access an css  webkit-keyframes property through javascript, but that is not work in apache corodova. 

    my code is...


    <!DOCTYPE html>
    <html>
    <head>
    <style> 
    #myDIV {
        width: 100px;
        height: 100px;
        background: red;
        ;
        -webkit-animation: mymove 1s infinite; /* Chrome, Safari, Opera */
        animation: mymove 1s infinite;
    }

    /* Chrome, Safari, Opera */
    @-webkit-keyframes mymove {
        from {left: 0px;}
        to {left: 200px;}
    }

    /* Chrome, Safari, Opera */
    @-webkit-keyframes mynewmove {
        from {top: 0px;}
        to {top: 200px;}
    }

    @keyframes mymove {
        from {left: 0px;}
        to {left: 200px;}
    }

    @keyframes mynewmove {
        from {top: 0px;}
        to {top: 200px;}
    }
    </style>
    </head>
    <body>

    <button onclick="myFunction()">Try it</button>

    <div id="myDIV"></div>

    <script>
    function myFunction() {
        document.getElementById("myDIV").style.WebkitAnimation = "mynewmove 4s 2"; // Code for Chrome, Safari and Opera
        document.getElementById("myDIV").style.animation = "mynewmove 4s 2";
    }
    </script>

    </body>
    </html>


    This is the code but it was not work on my apache corodova app in visual studio 2015

    • Merged by Weiwei Cai Tuesday, December 15, 2015 2:18 AM duplicate
    Friday, December 11, 2015 8:29 PM
  • Hi Microsoft's Fan,

    To show your Console you can do this: Debug -> Windows -> JavaScript Console

    I found this answer on some forum threads so you can try something like this:

    "Visual Studio Tools for Apache Cordova uses same port for debugging after update v2.

    There are two way to walk over this issue.

    Use JavaScript Console of Visual Studio. Frankly, this way is OK for me when I am developing on PC with two displays (I runs emulator on one screen and debug with Visual Studio on another), but a bit uncomfortable when I am developing on Notebook with one screen.

    Run a solution without debugging (CTRL+F5), in this case VS's debugger isn't attached to browser. This looks as simple solution, but you need to be aware that in this case breakpoints don't stop run-time and you have to use debugger; keyword."

    Best regards!
    (If this was helpful for you, vote for it and propose it as an answer)

    Monday, December 14, 2015 1:23 PM