简体   繁体   中英

jQuery onclick event to add Dynamic Tabs for opening view page

i want to open view page in dynamically tabs in jQuery event

my clickable link

<li id="btnHtml">
<a href="#">  text </a></li>

jQuery code to add dynamically tab and open view page in the tab.

  var tabs = $('#tabs').bootstrapDynamicTabs().addTab({
        title: 'Home',
        Url: '/tab/ajax/file.html',
        id: 'ajax',
        ajaxUrl: '/tab/ajax/file.html',
        loadScripts: '/tab/js/load.js',
        loadStyles: ['/tab/css/test.css', '/tab/css/test2.css'],
        active: true,
        allowClose: false
    });

    $('#btnHtml').click(function () {
        tabs.addTab({

            title: 'example',
            type: 'POST',
            Url: "@Url.Action("Rep_Contracts", "Home")",
            id: 'ajax',
            ajaxUrl:  "@Url.Action("Rep_Contracts", "Home")",
            loadScripts: '/tab/js/load.js',
            loadStyles: ['/tab/css/test.css', '/tab/css/test2.css'],
            active: true,
            allowClose: false
        })
    });

the first tab works correctly ,but when click the link to open a second tab,it doesn't work.what's the problem with open the page url?

tnx向@vekay提出了他/她的有益意见。问题已解决

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM