Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to encode apostrophes for a webpage

i am using the cluetip plugin and the simple use case is to to put the content in a title attribute, like below:

<a title='Top title|detail content'>Text</a>

i am now running into issues where the string that is inside "detail content' has an apostrophe inside of it and it seems to confuse cluetip plugin. Is there anyway to escape or encode an apostrophe to allow cluetip to work properly.

like image 240
leora Avatar asked May 23 '11 02:05

leora


2 Answers

You're looking for &apos;.
See HTML entities.

like image 74
SLaks Avatar answered Sep 21 '22 01:09

SLaks


You'll want to use &#39; per this link since &apos; has flaky browser support. See this old post for more info.

like image 33
Quanta Avatar answered Sep 18 '22 01:09

Quanta