开发者

Escape & symbol in MailTo

I have a URL like this: http://localhost:9001/view/shopindex/display?keyword=test&searchPostcode=Postcode and I'm putting it in the body of a new email message using HTML mailTo (I know that there are better options to mailTo but I'm restricted to this). Effectively I have this:

<a href="mailto: ?subject=Look at this link&amp;body=http://localhost:9001/view/shopindex/display?keyword开发者_运维百科=test&amp;searchPostcode=Postcode"></a>

The problem is that when I click and I get the new e-mail message opened, I get only the following in the body:

http://localhost:9001/view/shopindex/display?keyword=test

I think the mailto is identifying the & symbol in the query string of the web page URL as part of the mailto URL. Is there a way I can escape it?

Thanks!

Krt_Malta


Try URL-encoding the ampersand character instead:

http://localhost:9001/view/shopindex/display?keyword=test%26searchPostcode=Postcode

It works fine for me in Firefox, you can test it here.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜