bynx
bynx

Reputation: 11

'&' not displaying in IE & safari in a span

When i click in in button, the & character in the textbox is not displaying in span as i m using (also doesnt dispalys in div, p etc). I am using jQuery for the button click. I also tried to use $.URLEncode $.URLDecode but result was negative.

I will be grateful if anyone can help me.

Upvotes: 0

Views: 82

Answers (2)

Delan Azabani
Delan Azabani

Reputation: 81384

URLEncode is not useful or relevant, as you're cleaning/escaping the output for HTML, not a URL component. Replacing & (which is a reserved symbol for the start of an entity) with & would correct the problem.

Upvotes: 0

rsp
rsp

Reputation: 111316

You have to use & to encode the ampersand in HTML.

Upvotes: 2

Related Questions