About that. Get. Post. Ajax Ztree also has a background servlet passing data

Source: Internet
Author: User

Servlet passes data string to foreground

The method used is

PrintWriter out = Response.getwriter ();

Response.sendredirect ("test.jsp");
String s = "[{' id ']: ' 1 ', ' pid ': ' 0 ', ' name ': ' test1 '},{' id ': ' One ', ' pid ': ' 1 ', ' name ': ' test11 '}, {' id ': ' + ', ' pid ': ' 1 ', ' name ' ': ' test12 '}, {' id ': ' 111 ', ' pId ': ' One ', ' name ': ' test111 '},] ";
Out.write (s);

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

The superficial understanding of the. Get. Post. Ajax is

The last one is asynchronous, the first two are synchronous (blocked)

. Get (Url,data,function (data,status) {

The function that executes

I understand that the data and URL parameters mean the same thing.

})

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

Use of Ztree:

Note the differences in the format of the Ztree two JSON,

Often the simple format is to show the structure of the tree directly through the relationship between the data

The second is through the escaping of JSON.

Note that the style and JS files must be introduced into the full

Then the

The position on the interface is UL

Then the

Note that the passing response is passed back by the type string, which is the method of the string conversion object

var ss = eval ("(" + Data + ")");

var t = $ ("#test");

Then the tree-controlled initialization (location, configuration, data)
t = $.fn.ztree.init (t, setting, SS);

Get the tree object and manipulate it

var ztree = $.fn.ztree.getztreeobj ("test");

Collect and organize the data of the backstage to solve the problem of the foreground.

About

. Get replaced by

. Ajax

$ ("button"). Click (function () {  $.get ("Demo_ajax_load.txt", function (Result) {    $ ("div"). html (result);  });});


------------
URL,
Data Success,
DataType });


About that. Get. Post. Ajax Ztree also has a background servlet passing data

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.