AJAX-Design Tutorials
AJAX-DesignUser Interface Elements
The client side of Ajax is highly influenced by user interface elements. Properly coding user interface elements is important because it will show data and even visual elements of an Ajax based websites. These user interface elements are launched in the innerHTML instead of DOM. InnerHTML could be configured in any way to be visually pleasing while DOM could have the same property, but developers would have to learn new coding wherein HTML could be used with tradition tags for building a website.
.
Init ()
The first interface element that could be used in innerHTML is the init () function. This element is the gateway for all the information from the server. This function could accept any feed given by the server and feeds them to the right area in the website. In a multistage download type of Ajax website, init () could be use as the first feed while other functions prepares for additional command from the user. Init () becomes the first feed because it grasps almost every information, making specific information easier to access.
The feeds loaded by init () are received with a function getElementById (). With the right ID, the feed knows where to pass the information. Upon retrieval of information, the divFeedList is updated, enabling the client side for information streaming.
.
LoadFeed ()
Although init () could fetch the entire information from the server, it could be doing more than what it should. When the client needs specific information, it uses another function called LoadFeed (). This could be used independently with init () or it could be used to complement init () so that specific feed could be extracted. The main difference of LoadFeed to init () is its ability to function with OnClick command. Developers could make the LoadFeed work only when the user wants to.
The information from LoadFeed () is received by getListByFileName () which is eventually loaded to toggleLoadingDiv () for the specified area of the website. Because of the getListByFileName () function, LoadFeed () is usually identified with a filename attribute which is located the feed.
.
ItemClick ()
Like LoadFeed (), ItemClick () is also an event handler. ItemClick () could have the basic functions of LoadFeed () such as displaying the specified information to the user. However, it does more than simple feed – ItemClick could be used to trigger another command. ItemClick is often used as an interactive response to the user. When the user requests for a data, the information is displayed and at the same time, the background is changed or another option is given to the user.
The information from ItemClick is received by getElementById () and forwarded to oEl command. This command is basically used to influence other commands such as oSelected to determine if further actions are needed. oSelected are used by developers as a universal variable to keep track of the changes in the application.
Init (), LoadFeed () and ItemClick () are three user interface elements that could easily forward information to the user fast by using these functions to load the data feed from the server.
Sponsored Links
