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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:49:52+00:00 2026-06-04T04:49:52+00:00

I found a nice example on how to use AJAX in jQuery at this

  • 0

I found a nice example on how to use AJAX in jQuery at this link:
http://yensdesign.com/2008/12/how-to-load-content-via-ajax-in-jquery/

I added contents from index.html file to my view.php file (I’m using CodeIgniter).

Everything looks okay, but when you want to switch to another section, page content doesn’t change (same content as before shows up).

I think maybe there is a problem, for menu.js file to pass data to CodeIgniter view.php file?

Could you give me any suggestions on how could I solve this problem? I hope this would be helpful for others too.

Menu.js file:

$(document).ready(function(){
//References
var sections = $("#menu li");
var loading = $("#loading");
var content = $("#content");

//Manage click events
sections.click(function(){
    //show the loading bar
    showLoading();
    //load selected section
    switch(this.id){
        case "home":
            content.slideUp();
            content.load("sections.html #section_home", hideLoading);
            content.slideDown();
            break;
        case "news":
            content.slideUp();
            content.load("sections.html #section_news", hideLoading);
            content.slideDown();
            break;
        case "interviews":
            content.slideUp();
            content.load("sections.html #section_interviews", hideLoading);
            content.slideDown();
            break;
        case "external":
            content.slideUp();
            content.load("external.html", hideLoading);
            content.slideDown();
            break;
        default:
            //hide loading bar if there is no selected section
            hideLoading();
            break;
    }
});

//show loading bar
function showLoading(){
    loading
        .css({visibility:"visible"})
        .css({opacity:"1"})
        .css({display:"block"})
    ;
}
//hide loading bar
function hideLoading(){
    loading.fadeTo(1000, 0);
};

});

Animations from javascript is working (loading/content/sections) , but the real content isn’t loaded from html file.

As I said it looks like this script can’t load content to the view.php file (which is CodeIgniter ‘view’ file)

Any help is highly appreciated.

  • 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-04T04:49:53+00:00Added an answer on June 4, 2026 at 4:49 am

    CodeIgniter needs to serve sections.html and external.html. It will not do so by default.

    Assuming view.php is used for the URL http://example.com/index.php/mycontroller/view, then jQuery will send requests for the following URLs.

    http://example.com/index.php/mycontroller/sections.html
    http://example.com/index.php/mycontroller/external.html
    

    Unless you have told CodeIgniter what to do for these requests, CodeIgniter will return a 404 and your page content will not be updated.

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

Sidebar

Related Questions

I need to draw a pie chart. I found a nice tutorial here http://mac-objective-c.blogspot.com/2009/04/drawing-pie-charts.html
I found a nice script to import xml using powershell http://slash4.de/tutorials/Automatic_mediawiki_page_import_powershell_script Currently I don't
just was reading this article http://highscalability.com/blog/2010/3/23/digg-4000-performance-increase-by-sorting-in-php-rather-than.html And found this nice article http://wiki.apache.org/cassandra/DataModel I just
I just found out about yield return , I seems really nice. I use
By using Google I have found some nice snippets of example code for using
bad news this morning, I was willing to try and use Leksah (nice looking
I found this nice statement in a tutorial: for x,y in [(x,y) for x
Well I found a nice tutorial about how to program applications using Bonjour. It's
I just found a nice tutorial that will help me implement an easy user
I'm looking for nice loading indicators for Silverlight. I found a few, but all

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.