Xheditor rich text box storage value and display problems

Source: Internet
Author: User

Today, we found that the value stored in the database is something like this.

& Lt; P style = & quot; margin: 0px; padding: 5px 10px; Border: 0px none; line-Height: 28px; font-size: 14px; font-family: simsun, Arial, & #039; lucida Grande & #039;, verdana, lucida, Helvetica, sans-serif; text-align: justify; & quot; & gt; & amp; nbsp; & lt;/P & gt; & lt; P style = & quot; margin: 0px; padding: 5px 10px; Border: 0px none; line-Height: 28px; font-size: 14px; font-family: simsun, Arial, & #039; lucida Grande & #039;, verdana, lucida, Helvetica, sans-serif; text-align: justify; & quot; & gt; & amp; nbsp; strabismus, it refers to the phenomenon that the two eye axes cannot stare at the same target at the same time, but the other eye axis is biased towards the target side. There are many kinds of strabismus, the most common is the inner eye skew, Medical called inner strabismus, commonly known as "eye-to-eye", "Fighting chicken eye ". The eye is skewed outward, which is also known as "oblique white eye ". Of course, strabismus not only refers to a situation where the two eyes are obviously malformed at the relative position, but also involves a situation where the slope is very small and the surface is not easy to detect, and the eyes are not visually functional normally, it also includes situations where there is no oblique position but the eyes are abnormal. Therefore, the concept of strabismus should be understood as two abnormalities: the relative position of the eyes and the binocular visual function. & Lt;/P & gt; & lt; P style = & quot; marext-align: justify; & quot; & gt& gt; & lt; br/& gt;

This is only known to xheditor. After reading the API and demonstration, he can achieve a perfect display, but I still cannot find out how to save it for display.

My solution

1. Change the stored data, modify the code, and save only HTML files. Changed, but not changed;

2: recompile the browser;

function getHtml(str){            $x = ‘<input type = "hidden" name = "test" id = "test" value = "‘+str+‘">‘;            $("#help").append($x)            $val = $("#test").val()            $("#help").empty();            return $val;        }        $(function(){            $resArr = <?php echo $resForContent?>;            var html = ‘‘;            alert($resArr.length)            for($i = 0; $i<$resArr.length; $i++){                $tit = $resArr[$i].title;                $con = getHtml($resArr[$i].content);                if(($i+1)%2 == 0){                    html += ‘<td class="leftTd">‘ +                        ‘

The backend transmits JSON data to parse gethtml for the first compilation, and then obtains the real HTML code.


Once again, I used a wonderful way to solve the problem.

 

Xheditor rich text box storage value and display problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.