Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

request: expose serialize postData #9

Open
postite opened this issue Jan 9, 2016 · 0 comments
Open

request: expose serialize postData #9

postite opened this issue Jan 9, 2016 · 0 comments

Comments

@postite
Copy link

postite commented Jan 9, 2016

i had the need for modifying the values of a form in a pushstate.prevent.

would you expose the serializing postdata function to make it easier ?

something like that ?:

 public function serializeStatePostData(state:Dynamic):Dynamic {
var buf:StringBuf=new StringBuf();
for (a in Reflect.fields(state)){
    var p:String=Reflect.field(state,a);
    var _a=a+"="+p.urlEncode();
    buf.add(_a+"&");
}

Reflect.setField(state,"__postData",buf.toString());
return state;

}

perhaps i'm not doing it right but i don't get why we couldn't do it by default.
thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant