Example One
Here is an Example of the Ajax Engine in its simplest form, using only one menu, attatching its self to the element "main".
Full Script:
window.addEvent('domready',function(){
var firstAjax = new ajaxEngine('main',{
linksrc: "main_menu"
});
});
Example Two
Here is an Example of the Ajax Engine applying an image to the loading state.
this example takes the content inside the conainer Id'd as "main" from the other pages. if the loadFrom option is not set it
defaults to be the same id as the element it attaches its self to which in this case would be "example_two".
the use of the loadFrom also allows for data extraction of differant parts of the same link page by seperate ajaxEngine instances.
Script:
window.addEvent('domready',function(){
var secondAjax = new ajaxEngine('example_two',{
linksrc: "ex2_menu",
loadFrom: "main",
loadingImg: "loadingAnimation.gif"
});
});
Example Three
Here is an Example of the Ajax Engine using more then one menu system as its source for links.
if no menu id is given the engine defaults to useing every hyper link available on the page when it initializes. this is not recommened
this example takes the content inside the conainer Id'd as "main" from the other pages.
Script:
window.addEvent('domready',function(){
var thirdAjax = new ajaxEngine('example_three',{
linksrc: ["menu_one","menu_two"],
loadFrom: "main"
});
});