Switch to full style
JQuery Examples
Post a reply

Load Content to Tabs using AJAX and JQuery

Fri Jan 11, 2013 9:41 pm

Load Content to Tabs using AJAX and JQuery
javascript code
<html>
<head>
<title>Load Content to Tabs using AJAX and JQuery</title>

<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
<style type="text/css">
#myTabs,#tabOne
{
font-weight:bold;
background:#1314C1;
padding:0px;
color:Yellow;
}
</style>
<script>
$(function() {
$( "#myTabs" ).tabs({
beforeLoad: function( event, ui ) {
ui.jqXHR.error(function() {
ui.panel.html(
"The content of this tab couldn't be loaded.." );
});
}
});
});
</script>
</head>
<body>

<div id="myTabs">
<ul>
<li><a href="#tabOne">Home</a></li>
<li><a href="./smallTable.html">Tab 1</a></li>
<li><a href="./smallTable.html">Tab 2</a></li>

</ul>
<div id="tabOne">
<p>Home Page </p>
</div>
</div>


</body>
</html>


smallTable.html:

html code
<table>

<tr>
<td>
Acc-1
</td>
<td>
Acc-2
</td>
</tr>

<tr>
<td>
432USD
</td>
<td>
321USD
</td>
</tr>

</table>


To make tag open automatically when mouseover it :
javascript code
<script>
$(function() {
$( "#myTabs" ).tabs({
beforeLoad: function( event, ui ) {
ui.jqXHR.error(function() {
ui.panel.html(
"The content of this tab couldn't be loaded.." );
});
}
},{
event: "mouseover"
});
});
</script>




Post a reply
  Related Posts  to : Load Content to Tabs using AJAX and JQuery
 Load file and update content using AJAX and JQuery     -  
 Show Tabs Panel using JQuery     -  
 Load tweets using JQuery     -  
 Load RSS feeds and parse it with JQuery     -  
 Change the content of select tag using JQuery     -  
 Solution to Error status zero when using Ajax with JQuery     -  
 load class to applet- load frame class to applet     -  
 What is AJAX, How to start AJAX?     -  
 help me How do I load image from my pc to matlab     -  
 How to Load Files using JFileChooser!!     -  

Topic Tags

JQuery UI