Read some text data from MySQL, pay the JS variable for example
Copy Code code as follows:
<script type= "Text/javascript" >var strs= "Surun Grape Plantation relies on Shanghai-Nanjing Expressway and Yang Li-Li high-speed two traffic corridors, close to the town wing Road on the party town Xue Village section, from the Zhenjiang only 20 kilometers, convenient transportation Surun grape plantation introduced new varieties,
New technology, technology and modern management system, the use of greenhouse planting. At present, the main varieties have five: Shahe, beauty refers to your son, yellow honey, gold fingers. Surun Grape Planting Garden also ... ";
document.write (STRs);</script>
But found that Firefox always reported unterminated string literal error. Copy the text into TXT open found a few black box, the original is the MySQL line tag \ r \ n, in the TXT because of the use of double-byte and can not correctly display, so show 2 black squares.
WORKAROUND: When returning this data on the server side, remove \ r \ n
$value =str_replace ("\ r \ n", "", $value)