Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Implement javascript Api — Gideros Forum

Implement javascript Api

QkyGamesQkyGames Member
edited September 2016 in General questions
Hi,

I am starting with gideros today, and before to continue I need know if is possible add this library:

github.com/GameDistribution/GD-HTML5/wiki

and the spilgames api (javascript api) to my HTML5 games.

Regards.
Maxi.

Comments

  • I need have an html file with some code, and call some function from gideros to show ads or send score, etc
  • You can create a web service and call with urlloader easilly.
    http://giderosmobile.com/forum/discussion/2111/calling-a-webservice/p1

    For the ads why not to use AdsInterface plugin.
  • hgy29hgy29 Maintainer
    I added yesterday something that could help you with that:

    Newests HTML5 templates (like the unofficial one here: http://apps.giderosmobile.com/Html5.zip) will have a builtin way to call JS from Lua.

    Ex:
     JS.eval([[ alert("Hello!") ]])
    or
    local url=JS.eval([[ location.href ]])
  • Hi,

    thanks for your answers, I will try now.

    Regards.
    Maxi.
  • I download the zip, replace all in template folder but I get this error:
    attempt to index global 'JS' (a nil value)
  • JS.eval() will only work in a browser, so make sure you're not using it when in the local player or on device. One way of doing that is to read the application:getDeviceInfo().
    My Gideros games: www.totebo.com
  • thanks, for you help! I need contact with GD page to upload my game
Sign In or Register to comment.