Reputation: 222
On my homepage I am showing the feed from news website in one of my div using below code:
<div id="divResult">
<script language="javascript" type="text/javascript">
$('#divResult').load('NewsHeadlines.aspx #Test', function () {
});
</script>
</div>
My "NewsHeadlines.aspx" page takes around 6-7 seconds depending upon the response of news website. During this period my Home Page displays all the other data from Database and this news section keeps loading in asychrounous way. But until it returns the results I am not able to navigate to other page by clicking on the Home Page links.
I am using Master child forms and my Master page has ScriptManager inside it. All the child page contents are being shown in UpdatePanel.
Is there any way so that when user clicks on any hyperlink on Home page then it canel the Jquery request for newsheadlines and take the user to that page.
Upvotes: 1
Views: 483
Reputation: 8719
You might need to wrap that in a $(function() { ... });
document-ready call so it starts only when the page is done loading.
Upvotes: 1