Search the Community

Showing results for tags 'ajax'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 10 results

  1. Hey everybody, excuse my poor english ! I was using a single JS file for my program structured like this : index.html with <div id="timediv"></div> script.js with my Phaser code including anim function called in ajax.js. This function was declared after the update in script.js. ajax.js with function refreshdiv() which call lance() which call anim() every 60 seconds. Everything was ok like this Now I want to use states. I made : bootState, loadState and the main state called scriptState. But where do I have to place anim() declaration now ? I tried different places (in scriptState, after update, in create, in update, in bootState init etc...) but I have always the same message : Thanks a lot for your help !
  2. Hi, About my project: It is intended to be an up to 2 player street-fighter/tekken type of game. For a game dev class I have to create and deploy a javascript game. I would like to add the feature that the user can use their phone as a (wireless ideally) gamepad/controller and their desktop would be the monitor to show the game (this would all have to happen in real time). I don't have any back end development skills, nor do I really have the time to pick them up, so something like Websocket would be impractical (I know there is Kaazing, but I followed their documentation step by step and this caused issues very early). My question is can I do something like this in real time with Ajax? I do not know how to use Ajax just yet, but I figure I can pick this up much faster than learning backend. If not is their something where I can just copy the code entirely include it within my project (ofcourse giving the proper credit where its due) and edit the front end to apply to my game & gamepad.
  3. I developed an HTML5 app and i used as compiler and webview as renderer, when i launch the app from my phone XHR doesn't wotk, looking at console i have a message "404 not found", but url exist and if i launch app from a browser it wotks!!!! Is It possibile cocoon compiler disable Ajax request?
  4. Does bjs have a built-in way to make ajax calls (e.g. to a php script) or would I have to write my own script for that? Also, under the hood does bjs use jQuery or any other framework to load assets or is it completely independent?
  5. Hi guys, I have a strange problem: I load a minimal Phaser game via an AJAX request somewhere in my page, and the scroll positions resets on top of the page... only on mobile, it doesn't happen on desktop. I don't know why and it's driving me crazy. I have set up a minimal code that will reproduce the error on mobile. It is divided in two files. First, the index html where the AJAX request is made: <!DOCTYPE html><html><head> <title>TEST</title> <script src=""></script> <script src=""></script></head><body> <div id="box" style="margin-top:2000px"> <div id="test"></div> </div> <button id="btnload">LOAD</button> <script type="text/javascript"> $("#btnload").click(function() { $.ajax({ type: "GET", url: "test2.html", success: function(response) { $('#test').html(response); }, complete: function(xhr, status) {}, error: function() { alert("Error : could not connect to server"); } }); return false; }); </script></body></html>Then the second file that is used to give a response to the AJAX request (that is, an empty Phaser game) : <script type="text/javascript">// GAME OBJECTvar game = new Phaser.Game( 550, // width 380, // height Phaser.CANVAS, // renderer (CANVAS for better compatibility) 'test', // container HTML ID { preload: preload, create: create, update: update }, // available functions false // transparent background);function preload() {}function create() { game.stage.backgroundColor = '#000000';}function update() {}</script>When clicking on the "LOAD" button in index, the Phaser is correctly loaded, but the page resets itself on top. That is not wanted. How can I avoid this problem?
  6. Hi, I want to connect with a database to save the scores, but, on first, I'm making a test. I'm trying with this sample code to know if I could receive simply "text" request, var pause_ajax =,, "connection"); pause_ajax.inputEnabled = true; () { var ajaxUrl = ""; $.ajax({ url: ajaxUrl, dataType: "html", method: "post", beforeSend: function() { }, success: function() { alert("work"); }, error: function(){ alert("error") } }); }); The php file is on another server. When I click the label, this makes the connection but it don't recive anything. ResponseText="" php.php <?php session_start(); print "test"; ?> jQuery is correctly imported on my project. There are any other best option to save the scores on dataBase? Thanks
  7. Webcam performer seeking for developer to create an app. Hi! I need a software (game) which could be compatible with the website that I'm using to broadcast. The idea is - objects falling down in the broadcast window are operated by visitors from my chat, for example, when they press key 1. I found varieties of web cam games in google, but they all have to be operated by player who has the camera. What I'm looking for is a software which could allow people from the chat to be involved in the game too. DM if interested.
  8. Hi everyone i need a bit help with this and phaser what is the best way to load a json data from a server with jquery ajax, can i use jquery with phaser? can i use a ajax call like a webapp for example $.ajax({ type: GET,POST ETC, url: somewhere, data:some data, callback function....... }) or exist another way to do this . This is my first time with phaser and i am developing a game with this features: 1) i have a main view with a image logo 2) this second view is sign up form (i need send a json to the server) 3) the third view is for instructions and has the start game buttom 4) the next view is the first level 5) this view is after finish the level in this view we have a question (i need to do a get request to load questions and answers from the server and then send a POST request the answer to the server again)
  9. In 'preload' I'm using game.load.json('test', 'test.json');to load some data. This starts an asynchronous request, so I can only use the results in 'create' : var jsoncontents = game.cache.getJSON('test');But now I want to load some other json, based on the contents of the first json file. Somehow I need a synchronous request. With jQuery you can specify if an ajax-request should be asynchronous or not. Any way to achieve the same in Phaser?
  10. Hello Anybody, I just encountered a problem when preloading json, with IE9. I tracked the problem down the Phaser.Loader.jsonLoadComplete handler is using this._xhr.responseText instead of this._ajax.responseText when window.XDomainRequest is used. I checked the master/dev and parallel-loader branches there doesn't seem to be fix in place yet, is this a bug or am I missing something else here? Regards, Brad