Nicedit: Unable to display uploaded images

Source: Internet
Author: User

For background editing, you need to use the Rich Text Editor and select the lightweight nicedit.

[Demo is provided later in this article]

Demo author is rellen110, address is http://rellen110.iteye.com/blog/472371

---------------------

1. nicedit upload in the demo uses the "Upload. jsp" file for processing. Of course, you can also change it to your own file processing.

In the nicedit. js file

"Nicuri :'Upload. jsp',"

You can specify the server that processes the upload.Program.

 

2. Now let's talk about the problems encountered.

Status quo: files can be successfully uploaded to the server. There are two ways to check whether the file has been successfully uploaded.

1. Open the specified project directory of Tomcat and check whether there are newly uploaded images in the upload folder.

2. Open the nicedit. js file and press Ctrl + F to findUpdateFunction, and then add two alert statements that are commented out in the figure to check whether the returned JSON has a value,

If the above method is used for testing, it is determined that the file has been correctly uploaded to the server, and the server has also sent back the address to nicedit. However, the image is still invisible in the editor.

The reason may be the path.

For example, the page on which you currently use nicedit isRoot \ A \ editpage. jsp

The path to the Tomcat server isRoot \ upload \ xxxx.jpg

The image path returned by upload. jsp isUpload \ xxxx.jpg

It can be found that the returned image path is in the root directory, and the current editing page also

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.