Ron Hinds
16 years ago
I have a javascript function that accepts several parameters. One parameter
is the name of a business. The problem is, some business' names have an
apostrophe in them, e.g., Mike's Coffee Shop. I get a script error when a
name is passed in that fashion. How do I pass an apostrophe in a parameter?
I could just remove the apostrophe, but I would rather not do that.
Example:
<input type="button" id="next" onclick="navNext('Page.asp', 'Mike's Coffee
Shop');" value="Next">
The parameters are inserted by ASP variables, e.g., 'Mike's Coffee Shop'
would be '<%CustomerName%>'
is the name of a business. The problem is, some business' names have an
apostrophe in them, e.g., Mike's Coffee Shop. I get a script error when a
name is passed in that fashion. How do I pass an apostrophe in a parameter?
I could just remove the apostrophe, but I would rather not do that.
Example:
<input type="button" id="next" onclick="navNext('Page.asp', 'Mike's Coffee
Shop');" value="Next">
The parameters are inserted by ASP variables, e.g., 'Mike's Coffee Shop'
would be '<%CustomerName%>'