, , , , , ( ). :
:
$json:
<img src="img/map/"ST JOHN'S"_map.PNG"/ width="600">
$html:
<img src="img/map/ST JOHN'S_map.PNG"/ width="600">
$htmlent:
<img src="img/map/ST JOHN's_map.PNG"/ width="600">
$escape:
<img src="img/map/ST JOHN\'S_map.PNG"/ width="600">
$urlenc:
<img src="img/map/ST%20JOHN%27S_map.PNG"/ width="600">
( JSON, ).
, ( ).... , JSON.
JSON , , . , , JSON Javasscript, , , , :
$('#map_output').html('<p><img src="img/map/"+<?=$json?>+"_map.PNG"/ width="600"></p>');
. , . , , .
( \', ' URL %27) :
Escaping , Javascript, Javascript, HTML, , .
, HTML , ' HTML , , .
URL , URL.
, URL , URL-. , , , , (&) , URL , . , HTML- , - . Javascript, JSON .
, . : ? ? . , , " ", ?
, , , . ; - , , , .
In fact, you must avoid or encode all the lines you enter or output so that invalid characters work. Otherwise, Mr. O'Brien will have trouble entering his name on your site, and if he can handle it, you will have trouble displaying it later.
source
share