javascript code to send to server

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Post Reply
arunesh_mobicules
Posts: 3
Joined: 20 Aug 2013, 14:16

javascript code to send to server

Post by arunesh_mobicules »

Hi,

I am a flash (action script ) developer and i am sending the below code to server:

var sfso:ISFSObject = new SFSObject();
sfso.putInt("gameConfigId", configId);
this.mysfscomm.newExtensionReq("game.rowclickdata",sfso,null);

I have to use the same code in html5 , jquery and send it to smartfox server.

Can you please let me know what code should i write in place of this so that it starts working for html5 and jquery.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: javascript code to send to server

Post by Lapo »

In Javascript there's no SFSObject because most of the types supported by it do not exist in JS (e.g. byte, short, long, etc...)
Instead you just send a regular object, like this:

Code: Select all

var reqObj = {}
reqObj. gameConfigId = configId
...
...
Here's a full example of how to send an Extension request:
http://docs2x.smartfoxserver.com/api-do ... quest.html

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply