Ajax dominates the world Dojo integration chapter_dojo
WBOY
Release: 2016-05-16 19:16:17
Original
1245 people have browsed it
With more and more Ajax applications, various Ajax Library (Prototype), Ajax Framework (DWR), and Ajax Toolkit (Dojo, YUI) are becoming increasingly abundant. Is there any way to combine these? Similar to Spring's approach, of course I can't create an IoC microkernel to "glue" various Ajax together, but there should be no problem integrating these Ajax reusable components, so as to avoid reinventing the wheel. You can also use the strengths and avoid weaknesses of various Ajax to form a relatively comprehensive Ajax solution. It also increases the flexibility for developers to choose their own familiar Ajax components.
At present, our company has formed a complete set of products based on Ajax, which encapsulates its own Ajax front-end and back-end communication mechanisms and provides reusable client components. I tried to integrate our products with Dojo Toolkit. The following is my approach. The Dojo ComboBox Widget is integrated, which is actually an Auto Completion component, similar to Google Suggest.
Start with the test class test_ComboBox.html provided by Dojo, add a debugger for tracking and debugging, and clarify the loading process of Dojo Widget.
After tracking and debugging, I have a general understanding of Dojo's Widget: first, load the currently required JavaScript file, and then parse the entire html page. There are three ways to use widgets on the page: one is to add some attributes that Dojo can parse on the HTML element, such as
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn