-4

I have a parent page call.jsp on this page i have div tag and i want load this div tag with a page (veh.jsp) that already has jquery ui tabs and all the contents . Means I just want that page with tab to be loaded in the parent page without writing the code for the jquery tabs on call.jsp.

Cyber Dude
  • 61
  • 1
  • 1
  • 4
  • I don't understand really what you want, but maybe you can find something interesting here ->[JQuery UI tabs: How do I navigate directly to a tab from another page?](http://stackoverflow.com/questions/2554951/jquery-ui-tabs-how-do-i-navigate-directly-to-a-tab-from-another-page) – PaoloCargnin Jul 19 '13 at 07:10
  • I will make it clear .See i have this page call.jsp with an anchor tag with id="call" and a div tab with id="veh_tabs". I am having another page veh.jsp which has jquery ui tabs in it and each tab has some content .Now i want onclick of anchor tag i want the div whose id="veh_tabs" to be loaded loaded with the page veh.jsp with the tabs and contents via ajax .so onclick of the anchor tag iam making a ajax call and refreshing the div tag with veh.jsp but i am not getting the tabs functionality of jquery – Cyber Dude Jul 19 '13 at 07:34
  • Mhh...Ok i think I understand, it's not a little things, my adivice is to use the [load() function of jquery](http://api.jquery.com/load/) and read about Tabs api. You'll find what you need – PaoloCargnin Jul 19 '13 at 07:57
  • need somemore suggestions from others too – Cyber Dude Jul 19 '13 at 09:57

1 Answers1

1

I got the solution Guys. As I had said earlier I am having a page Veh.jsp which is having this jquery ui tabs and the contents. I am having another page call.jsp On this page i have an tag with id="call" and another tag with id="veh_tabs". Now I wanted onclick of the tag ,the of the page call.jsp. But the jquery tabs were coming as normal links not tabs . i found the solution after carefully going through the jQuery AJAX Methods .load().

The load() method loads data from a server and puts the returned data into the selected element.

$(selector).load(url,data,function(response,status,xhr))

Here,

url: the URL you wish to load(manadatory)

data: data to send to the server along with the request(optional)

Function(): callback function that is executed when the request completes.

the code is as follows:

 $("#veh_tabs").load('../veh.jsp>veh_id='+veh_id+'#tabs',(function(){
 $("#tabs".tabs({
 event:"mouseover"
 })
 }));

here veh.jsp is the url from which data is loaded

function() is the jquery tabs function which should run after loading the content . And the id :#tabs specified with a space says that parse the whole document and load the contents only from the element whose id is specified .

For more details on .Load() check this link

http://api.jquery.com/load/

Dhaval Simaria
  • 1,886
  • 3
  • 28
  • 36
Cyber Dude
  • 61
  • 1
  • 1
  • 4