How to integrate third-party jquery plug-ins in the dwz (Jui) Tutorial

Source: Internet
Author: User

The jquery plugin is generally initialized in $ (document). Ready ().

 

 
$ (Document ). ready (function () {// The document is ready, and the jquery plug-in is initialized |}); // or in the form of $ (function () {// The document is ready, initialize jquery plug-in });

Because dwz RIA is a rich client idea, it loads the interface to the browser when it is opened for the first time, and then interacts with the server through data storage without occupying the network traffic related to the interface.
That is to say, you only need to go to a complete page (usually the start page, such as index. aspx/index. PHP/index. JSP, etc.), only this page contains the complete HTML structure (

Because the basic principle of Ajax loading is: Ajax loads a piece of HTMLCodeThe fragment is put in a container of the current page (usually a div ). Of course, it can also be an XML or JSON structure, but it must be converted into HTML code snippets before being inserted to the current page. If you load a complete page (including the

After understanding the rich client idea, we can also understand why the integration of third-party jquery plug-ins in the dwz framework cannot be initialized through $ (document). Ready () in

Generally, the plugin initializes the initui processing in dwz. UI. JS, and the $. FN. loadurl () encapsulated by the initui () method dwz framework is automatically called. For jquery native load method, you need to manually call the $. FN. initui () plug-in. The initialization in initui () is to pay attention to the scope. There is a $ P in it representing the current Ajax loaded container. You only need to initialize the newly loaded content of the current container.

If ($. FN. ajaxtodo) $ ("A [target = ajaxtodo]", $ P). ajaxtodo ();

If ($. FN. dwzexport) $ ("A [target = dwzexport]", $ P). dwzexport ();

If some special Ajax interactions are involved, write the callback function to process them by yourself.

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.