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 7782909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:41:17+00:00 2026-06-01T19:41:17+00:00

A the end of my index.html file I’m including two script files. One of

  • 0

A the end of my index.html file I’m including two script files. One of files handles loading page content with jquery. The other file handles manipulating a tabbed content area on my home page, also jquery. If I put the file for the tabbed content area after the file for the ajax page load file, then tabs work but the ajax for the page load does not work. If I reverse the order of those files, then the page load ajax works but not the tabs. What could be causing this?

Here’s the file for the tabbed content:

$(document).ready(function (){
initialize();
});

function initialize() {
//Click on nav to load external content through AJAX
// $('#topnav a').click(function(e){
//  e.preventDefault();
//  $('#pages').load( e.target.href + ' #loadcontent'); //pages finished loading
// }); //clicked on nav

    $(function() {

    $("#tabedarea").organicTabs();

    $("tabedarea").organicTabs({
        "speed": 200
    });
});
}

(function($) {

$.organicTabs = function(el, options) {

    var base = this;
    base.$el = $(el);
    base.$navtabs = base.$el.find(".navtabs");

    base.init = function() {

        base.options = $.extend({},$.organicTabs.defaultOptions, options);

        // Accessible hiding fix
        $(".hidetabs").css({
            "position": "relative",
            "top": 0,
            "left": 0,
            "display": "none"
        }); 

        base.$navtabs.delegate("li > a", "click", function() {

            // Figure out current list via CSS class
            var curList = base.$el.find("a.current").attr("href").substring(1),

            // List moving to
                $newList = $(this),

            // Figure out ID of new list
                listID = $newList.attr("href").substring(1),

            // Set outer wrapper height to (static) height of current inner list
                $allListWrap = base.$el.find(".list-wrap"),
                curListHeight = $allListWrap.height();
            $allListWrap.height(curListHeight);

            if ((listID != curList) && ( base.$el.find(":animated").length == 0)) {

                // Fade out current list
                base.$el.find("#"+curList).fadeOut(base.options.speed, function() {

                    // Fade in new list on callback
                    base.$el.find("#"+listID).fadeIn(base.options.speed);

                    // Adjust outer wrapper to fit new list snuggly
                    //var newHeight = base.$el.find("#"+listID).height();
                    //$allListWrap.animate({
                    //    height: newHeight
                    //});

                    // Remove highlighting - Add to just-clicked tab
                    base.$el.find(".navtabs li a").removeClass("current");
                    $newList.addClass("current");

                });

            }   

            // Don't behave like a regular link
            // Stop propegation and bubbling
            return false;
        });

    };
    base.init();
};

$.organicTabs.defaultOptions = {
    "speed": 300
};

$.fn.organicTabs = function(options) {
    return this.each(function() {
        (new $.organicTabs(this, options));
    });
};

})(jQuery);  

And here’s the file for the page load ajax:

// remap jQuery to $
(function($){})(window.jQuery);


/* trigger when page is ready */
$(document).ready(function (){
    initialize();

});

function initialize() {
    //Click on nav to load external content through AJAX
    $('#topnav a, #bottomnav a').not('#bottomnav #fbcallus a').click(function(e){
        e.preventDefault();
        $('#pages').load( e.target.href + ' #loadcontent'); //pages finished loading
    }); //clicked on nav
    //handle AJAX for left nav

}
  • 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-06-01T19:41:18+00:00Added an answer on June 1, 2026 at 7:41 pm

    You’re creating global functions with the same name initialize change the names of those or just one. The one that’s loaded afterwards overrides the first

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly simple app (just one index.html file and a css file
In a basic Node.js application with a single app.js file and one index.html document
I've just set up static page caching using Zend_Cache_Backend_Static to serve cached html files
I have this code in my index.html.erb file in my project: <h1>Listing businesses</h1> <table>
In my index.html.erb file I'm trying to display the title to my object (a
I have several partials that I'm including in my Rails application.html.erb file , but
Assuming I have a directory structure similar to: path_to_file/one/index.html How can I set my
I get code from a website, something like (file name: index.php): <html> <body> <div
I index.html page that post data to page1.asp page1.asp transform the data and Post
If an HTML file (say, index.html) as well as a javascript file (say, library.js)

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.