Iframe and Ajax question

0 favourites
  • 6 posts
  • Hi all,

    Quick question, if I have an app with an iframed app both with an ajax command will it screw each command up or will it just take longer to process?

    What I'm thinking of doing is splitting my game up into the main window or the control window and and iframe. When the user clicks on the map command it pulls up the map subapp. Or the chat subapp. But I'm curious how the ajax would handle it if I did that. the subapp would pull the userid from the iframe urlbar and start its own processing. The main app would be ajaxing mysql for vital stats while the map would be ajaxing the map info.

    Would I be getting errors with that or just slower response times?

    Thanks,

    Lance

  • It sounds like it ought to work fine, as long as both frames are on the same domain. It should be equally fast as if one page made all the AJAX requests.

  • Ashley, sweet so it sounds like that ought to work fine. I wanted to modulize my game. I figured it would cut the complexity out of the game as I'm trying to make and rpg. Guess the side benefit is that I can make multiple ajax calls. :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley

    Ajax question. How do I use the data field in the post ajax expression? I can't find any documentation on it. I'm guessing it's easier than adding all the parameters into the address field but I'm not sure how to fill it in. If I want to post to example.com//example.php with parameters foo=1 and bar=2 How do I fill it in using both the address bar and data field below?

  • : the address would be "http://example.com//example.php", and the post data would be "foo=1&bar=2" (the same format you'd use in a URL).

  • Ashley,

    Ok, thanks. So I don't need to put the ? in the url?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)