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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:38:06+00:00 2026-05-22T19:38:06+00:00

I have 2 php pages named personal_info and portfolio. I load them via php

  • 0

I have 2 php pages named “personal_info” and “portfolio”. I load them via php functions in codeigniter http://www.mysite.com/controller/personal_info and http://www.mysite.com/controller/portfolio.

I have a page with menu tabs linked to personal_info and portfolio and I want to load the pages via ajax when a tab is clicked. If js is turned off in the browser the tabs should just go to the url.

I am using the jquery .load() function to load the pages.

<script type="text/javascript">     
$(document).ready(function(){
    $('#personal_info').click(function() {
        $('#result').load('personal_info #load'); //load fragments from #load div
    }); 

    $('#portfolio').click(function() {
        $('#result').load('portfolio #load');
    });         
});
</script>

HTML

<div id="tab"><a href="http://www.site.com/portfolio/edit/general_info" id="general_info">General Info</a></div>

<div id="tab"><a href="http://www.site.com/portfolio/edit/portfolio" id="portfolio">Portfolio</a></div>

<div id="result"></div>

Issue: When I click on a tab it treats it as a link and goes to the URL instead of loading the page via jquery. How can I disable the link if javascript is on? Also, I noticed that javascript is not loaded from fragments in the pages, and if I put the javascript in the page I load data it doesn’t pick it up.

What is a good solution for this?

EDIT:

For loading js, I just wrapped the entire page in the result div and am loading the other pages with the js and header, footer.

  • 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-22T19:38:07+00:00Added an answer on May 22, 2026 at 7:38 pm

    For the first issue: put return false; at the end of each ‘click’ function:

    $('#personal_info').click(function() {
        $('#result').load('personal_info');
        return false;
    }); 
    

    Edit: For the second issue, maybe pull out any jquery/javascript and run it from a central application.js file?

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

Sidebar

Related Questions

I have pages named help.php , about.php and the address will look like: www.example.com/help.php
have a look at the top menu on these two pages on Firefox: http://outsidemma.com/2010/100031-bj-penn-the-prodigy-jay-dee.php
I have the following pages: page1.php, page2.php and page3.php. Code in each of them
I have a PHP page and I want to share some data between pages
I have the following pages: page1.php <?php if (isset($_GET['link'])) { session_start(); $_session['myvariable'] = 'Hello
I have a website which uses PHP and HTML pages, I want to create
I'm programming in PHP and would like to create web pages which have email
I have a <?php print $search_box; ?> in my page.tpl.php page. On pages that
I have two pages name one.php and two.php in one.php i have a combo
I have a php page named import.php. while executing this file a lot of

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.