Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to call a JS file from a JQuery Function?
    primarykey
    data
    text
    <p>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.</p> <p>I have tried the following but its not working.</p> <pre><code>$.getscript </code></pre> <p>How does one load a JS file in jQuery?</p> <p>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</p> <p>Tabs Code </p> <pre><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(); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload