Page 1 of 1

javascript code to send to server

Posted: 27 Aug 2013, 12:57
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.

Re: javascript code to send to server

Posted: 27 Aug 2013, 14:57
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