问题
I have a variable in a resource file (.resx), the value having the word you'd
.
When I try to use this variable directly in an alert box it displays you'd
as you'd
.
What could be the issue? and how do I resolve it?
回答1:
Try this:
alert('@System.Web.HttpUtility.JavaScriptStringEncode("Hello, You'd like this.")');
来源:https://stackoverflow.com/questions/17919697/resource-file-variable-giving-string-ascii-code-issues-in-js-alert-box