Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does & become &

Tags:

html

encoding

We have a TinyMCE Editor and we sent the images that can be inserted into the editor like this:

'test?foo=something&bar=something'

When I view the source in TinyMCE it becomes :

<img src="test?foo=something&amp;bar=something"/>

Why does & become &amp;? What is the main idea behind that?

Which software does this conversion automatically because I can't see any explicit code . I am aware of HTML Entities .

like image 883
Nishant Avatar asked Apr 20 '26 06:04

Nishant


1 Answers

There are some special characters which are reserved in HTML. These characters can not be used directly like other character.

For example, all the tags in HTML are enclosed in LESS THAN and GREATER THAN signs (ie '<' and '>'). So to display the '>' or '<' sign in HTML page, it converts the character to HTML code. These HTML codes are converted to ascii character by the browser.

& is the HTML code for '&'.

There are many other special characters. Some of them are listed in the link below.

http://www.w3schools.com/html/html_entities.asp

like image 181
user1419238 Avatar answered Apr 23 '26 04:04

user1419238



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!