473,385 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to update tab content using jQuery

rizwan6feb
108 100+
Hi
I have created a tabbed interface using jQuery using the code below

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.      <script type="text/javascript">
  5.         $(document).ready(function(){
  6.             $('#tabs').tabs({ remote: true });
  7.         });
  8.     </script>
  9. </head>
  10.  
  11. <title>Ajax Tabs</title>
  12.  
  13. <body>
  14.  
  15.     <h2>Ajax tabs</h2>
  16.  
  17.     <div id="tabs">
  18.         <ul>
  19.             <li><a href="p1.html"><span>One</span></a></li>
  20.             <li><a href="p2.html"><span>Two</span></a></li>
  21.             <li><a href="p3.html"><span>Three</span></a></li>
  22.         </ul>
  23.     </div>
  24.  
  25. </body>
  26. </html>
  27.  
  28.  
Offcourse all the external script files have been included, and the tabs are working fine, what i want to do is

I have a fourth html file named p4.html, also p3.html contains a link to this file. i want to replace the content in the third tab with p4.html (when a link in p3.html file is clicked). Please help
Oct 17 '08 #1
10 7365
acoder
16,027 Expert Mod 8TB
Is this what you're looking for?
Oct 17 '08 #2
rizwan6feb
108 100+
This seems to be the solution but not working for me, i have tried like this

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2.  <html xmlns="http://www.w3.org/1999/xhtml">
  3.  <head>
  4.       <script type="text/javascript">
  5.          $(document).ready(function(){
  6.              $('#tabs').tabs({ remote: true });
  7.          });
  8.     $('#tabs').tabs({
  9.         load: function(e, ui) {
  10.             $('a.link', ui.panel).click(function() {
  11.                 $(ui.panel).load(this.href);
  12.                 return false;
  13.             });
  14.         }
  15.     });
  16.      </script>
  17.  </head>
  18. <title>Ajax Tabs</title>
  19.  <body>
  20.      <h2>Ajax tabs</h2>
  21.       <div id="tabs">
  22.          <ul>
  23.              <li><a href="p1.html"><span>One</span></a></li>
  24.              <li><a href="p2.html"><span>Two</span></a></li>
  25.             <li><a href="p3.html"><span>Three</span></a></li>
  26.          </ul>
  27.      </div>
  28.    </body>
  29.  </html>
  30.  

p3.html contains a link to p4.html and a class with name 'link' is applied
Oct 18 '08 #3
rizwan6feb
108 100+
Please help.........
Oct 18 '08 #4
acoder
16,027 Expert Mod 8TB
Where's the jQuery file included in your code?
Oct 20 '08 #5
rizwan6feb
108 100+
Where's the jQuery file included in your code?
Offcourse the file is included, before line #4 in the head section, if it was not there, tabs should not be working
Oct 20 '08 #6
acoder
16,027 Expert Mod 8TB
Besides that line, have you got any other code in that test page? Try with a simple test exactly as described and then build from there.
Oct 20 '08 #7
rizwan6feb
108 100+
I have attached a zip file containing all the scripts and html files. Please find a link in the third tab which in not opening in the current tab, clicking the link leaves the tabbed interface
Attached Files
File Type: zip jquery.zip (32.7 KB, 211 views)
Oct 21 '08 #8
acoder
16,027 Expert Mod 8TB
It seems as if the function has not been applied to the link. Try selecting all links.
Oct 21 '08 #9
rizwan6feb
108 100+
It seems as if the function has not been applied to the link. Try selecting all links.
I have selected all links, still not working
Oct 22 '08 #10
rizwan6feb
108 100+
Anyone with a better response ?
Oct 24 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Irmen de Jong | last post by:
Hi I'm trying to create e-mail content using the email.MIMEText module. It basically works, until I tried to send mail in non-ascii format. What I did, to test both iso-8859-15 and UTF-8...
4
by: Kannan s | last post by:
Dear Sir, Sub: help requred to build an Update Query using if or iif I am having two tables with the following fields I wish to create a single update query in MS Access Table1: code,...
5
by: SQL Learner | last post by:
Hi Alex (Kuznetsov) and All, This is to follow up with my last post, "Link two tables using partial word match". How can I UPDATE table using partial word match? How can I write a SQL statement...
2
by: darrel | last post by:
I'm still struggling to find a javascript/ajax library that I want to stick with for a while. JQuery is looking great these days...refined, LOTS of plug-ins, and an active community. Is...
4
by: pavanip | last post by:
Hi, I want to popup aspx page using jquery. I have written the following code <a href="Contactus.aspx?TB_iframe=true&height=250&width=200" class="thickbox" >AboutUs</a> I have called...
25
pradeepjain
by: pradeepjain | last post by:
<html> <head> <script src="jquery.js" type="text/javascript"></script> <script src="jquery.rating.js" type="text/javascript" language="javascript"></script> <link...
1
semanticnotion
by: semanticnotion | last post by:
I have a page that lists records from a database call. I want to have an 'edit' link on each row that will popup a Jquery dialog so that the row can be edited. My question is how do I pass the data...
0
by: rhtdmrai | last post by:
I want to apply autocomplete in gridview (in asp.net3.5 with C#) using jquery and this gridview is within the ajax update panel <asp:UpdatePanel ID="UpdatePanel1" runat="server"> ...
1
by: apssiva | last post by:
Hello All, 1. First i select the class name in combo box -> using jQuery reload the page. 2. after reload the page, Student name was display in random. so i add two radio button. 1....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.