Search with apostrophe in name
Search with apostrophe in name
I'm using a content management system which is automatically converting the apostrophe in, for example, O'Henry, to the equivalent typographically correct character entity &-#-8217-; I cannot change this without hacking the core.
When someone uses the built-in search to search for O'Henry, it will not be returned. I'd like to do a simple js search and replace to make that apostrophe a regular old straight apostrophe since that is what people would type in the search but it seems that the character entity is being converted by datatables and output directly as the curly apostrophe? I'm sorry for not being better able to explain what I am seeing--I could never get my head around Firebug so I am using thee Web Developer toolbar in Firefox and then viewing generated source. What I see is the text curly apostrophe.
I have figured out a way to do the replace and it works but I'm not sure it's the best way. Is there anyway you could help me with this since I'm not 100% understanding what datatables is doing to the data? Here's what I have; the id of the table containing all the data is "safehomes."
[code]$("#safehomes").html($("#safehomes").html().replace(//g, '''));[/code]
When someone uses the built-in search to search for O'Henry, it will not be returned. I'd like to do a simple js search and replace to make that apostrophe a regular old straight apostrophe since that is what people would type in the search but it seems that the character entity is being converted by datatables and output directly as the curly apostrophe? I'm sorry for not being better able to explain what I am seeing--I could never get my head around Firebug so I am using thee Web Developer toolbar in Firefox and then viewing generated source. What I see is the text curly apostrophe.
I have figured out a way to do the replace and it works but I'm not sure it's the best way. Is there anyway you could help me with this since I'm not 100% understanding what datatables is doing to the data? Here's what I have; the id of the table containing all the data is "safehomes."
[code]$("#safehomes").html($("#safehomes").html().replace(//g, '''));[/code]
This discussion has been closed.