Load file once with jQuery ajax load method
Loading a file onclick only once, for the first click, on the next clicks the content of the div into which the file is loaded won't be empty so the file won't be loaded twice.
<div id="myContent"></div>
<a href="javascript:void(0);" id="myLink">Click to load file</a>
<script type="text/javascript">
$('a#myLink').click(function() {
if($('#myContent').html() == '') {
$('#myContent').load('path-to-file.html');
}
});
</script>
Latest news
- - S5 Slide Show System: PowerPoint on Linux
- - µTorrent for Linux
- - Linux audio tagger
- - Gnome 3 release date - interview with Stormy Peters
- - Ubuntu Maverick Meerkat Beta Released
- - Ubuntu Maverick Meerkat frozen
- - Tab Candy for Firefox
- - Ubuntu font launched for beta testing
- - Interview with Richard Stallman
- - Linux Mint 9 KDE released
- - Gnome 3 release date delayed to march 2011