sending a single quote in html parameters

Posted on 2002-03-28
Last Modified: 2010-04-09
I am building an A href.  The href MUST contain a single quote in the parameter.  When i link, the html truncates at the single quote.
the link looks like this. It is using two seperate single quotes.  

<A href = theAsset.jsp?AssetName=19'' Dell>19'' Dell</A>

However when the mouse is hovered over the link the link appears as so:


How can i fix this?

Is there a way to fix this so each line does not need escape sequences.  In other words so that the page need not be hard coded on each line to fix it.  This is important because I will not always know when single quotes are in the link.

Finally, why is this happening?

Question by:rm3
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +4

Expert Comment

ID: 6903554
Hi rm3,

You need to but double quotes around the your link as follows:
<A href="theAsset.jsp?AssetName=19'' Dell">19'' Dell</A>
LVL 22

Accepted Solution

CJ_S earned 50 total points
ID: 6903633
to make it work in netscape also

<a href="thisAsset.jsp?AssetName=19%27%27%20Dell">19 Dell</a>


<a href="" onClick="this.href=escape('theAsset.jsp?AssetName=19\'\' Dell')">Dell 19M</a>

LVL 12

Expert Comment

ID: 6904398
Ya for certain special characters you need to place the \ before the characters itself; this i guess is a primitive dos standard still followed; the single quote is one of these special characters;

others are
\n -> New Line
\\ -> Backslash
\" -> Double Quotes

in modern day use, withing a pair of quotes, if quotes apper, they should have the \ character before them, which says that this isn't the end of quotes but is just the haracter;

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 23

Expert Comment

ID: 6904836
safest is CJ_S's recommendation.
LVL 12

Expert Comment

ID: 6905010
LVL 11

Expert Comment

ID: 6913658
CJs is the only correct HTML solution. Using any illegal character in a URL will give you different problems across different browsers, colons for example work in one browser but not in another (thats IE and Netscrap, not tried it on any others)

LVL 53

Expert Comment

ID: 6975502
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

LVL 11

Expert Comment

ID: 6976857
points to CJS I reckon
LVL 53

Expert Comment

ID: 7003661
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

points to CJ_S


If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.


Expert Comment

ID: 7066757
Thanks, Cd&, for your help here.

This has been finalized today, and monitoring for comments.

Moondancer - EE Moderator

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Html split(text) Part2 6 41
How to pass values to HTML-5 attribute dynamically? 24 64
HTML editor custom button 3 84
Sending HTML Formatted Email from ASP.NET 2 53
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question