Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Can I use Application.ExternalCall for WebGL

Discussion in 'WebGL' started by 8Observer8, May 23, 2016.

  1. 8Observer8

    8Observer8

    Joined:
    Apr 29, 2015
    Posts:
    99
  2. alexsuvorov

    alexsuvorov

    Unity Technologies

    Joined:
    Nov 15, 2015
    Posts:
    327
    Hello 8Observer8.

    Yes, you can use Application.ExternalCall() and Application.ExternalEval() to execute JavaScript. However, you should use those functions wisely, as they involve JavaScript eval() and therefore you may face security restrictions in some situations (i.e. when using Chrome packaged app).

    The recommended way would be to use a JavaScript plugin: http://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html
     
    8Observer8 likes this.
  3. 8Observer8

    8Observer8

    Joined:
    Apr 29, 2015
    Posts:
    99
    Thanks! Ok, I will use JavaScript plugins and SendMessage for callbacks
     
  4. DunanStar

    DunanStar

    Joined:
    Jun 23, 2016
    Posts:
    12
    Hi,
    How can I call jquery function from jslib?