Skip to content

Instantly share code, notes, and snippets.

@g8up
Last active February 27, 2016 20:19
Show Gist options
  • Save g8up/857303297a31ee7a87c4 to your computer and use it in GitHub Desktop.
Save g8up/857303297a31ee7a87c4 to your computer and use it in GitHub Desktop.
Sttdecode.fn.js
Sttdecode = function(rawData) {
if (rawData == "") {
return false
}
var kvs = rawData.split("/");
var obj = {};
kvs.forEach(function ( kv ) {
if (kv.indexOf("@=") > -1) {
var a = kv.split("@=");
obj[ de_filter_str(a[0]) ] = de_filter_str(a[1]);
}
});
return obj;
}
getsttdata = function ( obj, key ) {
return obj[key] || null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment