Y
Yansky
Is there a way to convert an object to it's source code as a string
without using the "toSource()" method? What I want to do is something
like this:
var myJSONObject = {"bindings": [
{"ircEvent": "PRIVMSG", "method": "newURI", "regex":
"^http://.*"},
{"ircEvent": "PRIVMSG", "method": "deleteURI", "regex":
"^delete.*"},
{"ircEvent": "PRIVMSG", "method": "randomURI", "regex":
"^random.*"}
]
};
convertToString(myJSONObject);
which would ooutput: '{bindings:[{ircEvent:"PRIVMSG", method:"newURI",
regex:"^http://.*"}, {ircEvent:"PRIVMSG", method:"deleteURI",
regex:"^delete.*"}, {ircEvent:"PRIVMSG", method:"randomURI",
regex:"^random.*"}]}'
Any help would be appreciated.
Cheers,
Yansky.
without using the "toSource()" method? What I want to do is something
like this:
var myJSONObject = {"bindings": [
{"ircEvent": "PRIVMSG", "method": "newURI", "regex":
"^http://.*"},
{"ircEvent": "PRIVMSG", "method": "deleteURI", "regex":
"^delete.*"},
{"ircEvent": "PRIVMSG", "method": "randomURI", "regex":
"^random.*"}
]
};
convertToString(myJSONObject);
which would ooutput: '{bindings:[{ircEvent:"PRIVMSG", method:"newURI",
regex:"^http://.*"}, {ircEvent:"PRIVMSG", method:"deleteURI",
regex:"^delete.*"}, {ircEvent:"PRIVMSG", method:"randomURI",
regex:"^random.*"}]}'
Any help would be appreciated.
Cheers,
Yansky.