Avatar of erikTsomik
erikTsomik
Flag for United States of America asked on

jquery tabs with panelTemplate is not wrking

I am trying to use jquery tab and load the content withing the iframe. I see it executing the click but the content does not get loaded into the iframe


$( "#tabs" ).tabs({
            panelTemplate: "<iframe style='width:950px;'></iframe>",
            idPrefix: "ui-tabs-",
            select: function(event, ui) {
                if (!$("#ui-tabs-" + ui.index).prop("src")) {
                  $("#ui-tabs-" + ui.index).attr("src", $.data(ui.tab, 'load.tabs'));  
                }
            }
        });
jQueryAJAXJavaScript

Avatar of undefined
Last Comment
erikTsomik

8/22/2022 - Mon
Coast Line

Did you tried the alert inside the if block, what exactly it is coming
erikTsomik

ASKER
i have change the code a little bit so it looks like this now ,however when the tab is cliked the content is loaded then goes back to tab 0 (first tab ), so ca not see the other tabs
$( "#tabs" ).tabs({
        panelTemplate: "<iframe style='width:950px;'></iframe>",
        idPrefix: "ui-tabs-",
            selected:0,
            cache: false,
        select: function(event, ui) {
                  //alert(ui.newPanel);
                  //alert(ui.index);
     
              $("#ui-tabs-" + ui.index).attr("src", $.data(ui.tab, 'load.tabs'));  
     
        }
    });
ASKER CERTIFIED SOLUTION
Md Shah

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
erikTsomik

ASKER
great
Your help has saved me hundreds of hours of internet surfing.
fblack61