Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7629005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:43:33+00:00 2026-05-31T05:43:33+00:00

I have a function in jQuery and I want that where that function is

  • 0

I have a function in jQuery and I want that where that function is triggered one of my JS file should be called on that particular event.

I have tried the following but its not working.

$.getscript 

How does one load a JS file in jQuery?

The thing is i have one page that is calling webservices through ajax and i am using Grid to display. and i have edit button in the grid. when the user press the edit button i want one tab (out to four) to be selected.. so for that i need to call a Tab.js in order to go to particular tab. here is Tab code..Wait i am editing the code of my post

Tabs Code

(function($, undefined ) {
$.widget( "mobile.tabs", $.mobile.widget, {
options: {
    iconpos: 'top',
    grid: null,
    load: function(event, ui) { },
    beforeTabHide: function(event, ui) { },
    beforeTabShow: function(event, ui) { },
    afterTabShow:  function(event, ui) { }
},
_create: function(){
    var
        $this = this,
        $tabs = this.element,
        $navbtns = $tabs.find("a"),
        iconpos = $navbtns.filter('[data-icon]').length ? this.options.iconpos : undefined;
    var $content = $tabs.closest('div[data-role="page"]').find('div[data-role="content"]');

    $tabs
        .addClass('ui-navbar')
        .attr("role","navigation")
        .find("ul")
            .grid({grid: this.options.grid });

    if( !iconpos ){ 
        $tabs.addClass("ui-navbar-noicons");
    }

    $navbtns
        .buttonMarkup({
            corners: false,
            shadow:  false,
            iconpos: iconpos
        })
        .removeClass('ui-link');

    // Set up the direct children of the page as the tab content, hide them
    $content.children().addClass('ui-tabs-content');

    // Now show the one that's active
    if( $navbtns.filter('.ui-btn-active').length == 0 )
        $navbtns.first().addClass('ui-btn-active');
    $content.children('#' + $navbtns.eq($this.currentTab()).attr('href')).addClass('ui-tabs-content-active');

    $navbtns.bind('click', function(event) {
        navButtonClick.call(this, event);
        return false;
    })
    .bind('tap', function(event){
        navButtonClick.call(this, event);
        return false;
    });

    function navButtonClick(event) {
        $navbtns.removeClass( "ui-btn-active" );
        $( this ).addClass( "ui-btn-active" );
        $this.changeTab(event, {
            currentTab: $navbtns.eq($this.currentTab()),
            nextTab: $(this),
            currentContent: $this.currentContent(),
            nextContent: $content.children($(this).attr('href'))
        });
        event.preventDefault();
    }

    this._trigger('load', null, {
        currentTab: $navbtns.eq($this.currentTab()),
        currentContent: $this.currentContent()
    });
},
currentTab: function() {
    var $tabs = this.element,
    $navbtns = $tabs.find("a");
    return this.element.find('.ui-btn-active').parent().prevAll().length;
},
currentContent: function() {
    return this.element.closest('div[data-role="page"]').find('div[data-role="content"]').children().filter('.ui-tabs-content-active');
},
changeTab: function(event, ui) {
    if( this._trigger('beforeTabHide', event, ui) )
        ui.currentContent.siblings().andSelf().removeClass('ui-tabs-content-active');
    if( this._trigger('beforeTabShow', event, ui) )
        ui.nextContent.addClass('ui-tabs-content-active');
    this._trigger('afterTabShow', event, $.extend({}, ui, { previousContent: ui.currentContent, currentContent: ui.nextContent, nextContent: null }));
}
});
})( jQuery );

$('[data-role=page]').live('pagecreate', function(e) {
$(this).find('[data-role="tabs"]').tabs();
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:43:34+00:00Added an answer on May 31, 2026 at 5:43 am

    Using Google analytics example, I would suggest you add before you close your <body> tag:

     <script type="text/javascript">
       var url = 'http://example.com/script.js';
       document.write(unescape("%3Cscript src='" + url + "' type='text/javascript'%3E%3C/script%3E"));
     </script>
    

    I am assuming you would need something like this:

    $('#editBtn').click(function() {
       var url = '/js/Tabs.js';
       document.write(unescape("%3Cscript src='" + url + "' type='text/javascript'%3E%3C/script%3E"));
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function called Colorbox (jQuery plugin) that takes a number of parameters
I have a jQuery function already to perform the task I need but is
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have the following scenario jQuery('#content').fadeOut('slow',function(){ jQuery('#content').load(detail.php?product=+imgID+&category=+cat); jQuery('#content').fadeIn('fast'); }); My problem however is that
Here's the story... I have a jQuery function that does something, this function is
I have the following jquery function for filtering the contents of a listbox on
I have the following jquery function > <script type=text/javascript> > > $(document).ready(function() { >
I have the following jQuery function: $(function(){ if ($(.menu li).hasClass(active)) { $(.active).css(margin-top, 6px); }
I have created the widget in Jquery mobile for Tabs. I want that when
I have some jQuery that is triggered on click of a link with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.