I have the code below loading in the content I have in the test.php file. There's a lot of code in the php file so takes a bit of time to load. When it does load the "load content" text remains. I want to be able to: - display a loading symbol whilst the page is loading - hide the "load content" text once the content has appeared
How would I do this?
<script type="text/javascript">
$(document).ready(function(){
$("a").click(function(){
$("#test").load('test.php');
});
});
</script>
<div id="test"></div>
<a>Load content</a>
UPDATE:
Also I would like the it to be a link (as it currently doesn't work on a touch device) - any suggestions?
Load contentinside your div as OptimusCrime said or just hide it:$("a").hide();load. Then, inload's callback, hide theatag.hrefattribute toatag?