In one of my projects, I need to add several static pages to it. Those pages are static html and will not need update.
To make this separate from the main project which has a good MVC structure, I use JQuery’s Ajax function to load those static pages.
First of all, here is a menu from index.html page.
<ul>
<li><a id="page1" href="#">About</a></li>
<li><a id="page2" href="#">Community</a></li>
<li><a id="page3" href="#">Sponsor</a></li>
</ul>
<div id="result" style="clear:both;">
</div>
At the head part, we need to include JQuery library.
<script src="http://code.jquery.com/jquery-1.4.min.js" type="text/javascript"></script>
Add the following code to head part.
<script type="text/javascript">
$(document).ready(function(){
$("#page1").click(function(){
$(#result).load(pages/page1.html);
//alert("Thanks for visiting!");
});
$("#page2").click(function(){
$(#result).load(pages/page2.html);
//alert("Thanks for visiting!");
});
});
</script>
That’s it! So simple. Of course, you have a directory /pages/ which contains several static html pages for loading.
Original Source:http://www.programcreek.com/2010/01/use-jquery-ajax-to-load-static-html-page-to-a-div-tag/
Related Stuff
-
MooV: Using cutting edge Video phones and Software Video Phones - coupling all that with VoIP and empowering the disabled.
-
Moo Telecom: VoIP communications made easy - Ring anyway with the fun and ease of using a normal phone
-
TagR:Mobile Social Network with Real Time Locations Based services, and Ambience Intelligence, VoiP, IM, Skype, Googletalk, Mapping, Flickr, Events, Calendaring, Scheduling, SecondLife Support
-
ClearSMS : ClearSMS is a Web-based application that lets you send bulk SMS messages to your customers, contacts, or just about anyone.
-
Jajah:jah is a VoIP (Voice over IP) provider, founded by Austrians Roman Scharf and Daniel Mattes in 2005[1]. The Jajah headquarters are located in Mountain View, CA, USA, and Luxembourg. Jajah maintains a development centre in Israel.
-
Skype: It’s free to download and free to call other people on Skype. Skype the number one voice over ip software
- PrivatePhone: a free local phone number with voicemail and messages you can check online or from any phone.
