开发者

Whats the best way to encode form data?

I'm still struggling with this mystery. Take a look at this jsfiddle The seria开发者_如何学Golized data is getting sent to my php function like so:

headline:I'm+still+here!

I need the data to look like this:

headline:I%27m+still+here%21

Do I need to call the replace method on my serialized data and just convert the single quotes or is there a better way?


Why do you need to escape 's? The apostrophe is a valid character in URLs according to RFC 3986. Presumably, that is why jQuery is not escaping it for you.

If you must escape it for some reason, then yes - use the replace method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜