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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:24:21+00:00 2026-05-13T19:24:21+00:00

How can I load a new page in my particular div using ajax in

  • 0

How can I load a new page in my particular div using ajax in CodeIgniter framework?

I have written the function and it works with plain php.

Example:

href="abc1.php" onclick="makerequest('abc1.php','div_name');return false;"> Page 1

href="abc2.php" onclick="makerequest('abc2.php','div_name');return false;"> Page 2 

Note: ajax makerequest function is working properly.

My problem is: how can I pass my view file in replace of abc1.php/abc2.php in CodeIgniter framework? Those files are located on my base_url/view/. I try to retrieve the filename using controller but it isn’t working.

see my code below:

..........................link.............
 href="<?=base_url()?>main_controller/newPage1.html" onclick="makerequest('<?=base_url()?>main_controller/newPage1.html','upper_middle');return false;">abc1 

href="<?=base_url()?>main_controller/newPage2.html" onclick="makerequest('<?=base_url()?>main_controller/newPage2.html','upper_middle');return false;">abc2 
.................................
...........controller code...

function newPage1()
{
  return $this->load->view('abc1.php');    
}

How can I do that? Or is there any other way to do it easily?

  • 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-13T19:24:21+00:00Added an answer on May 13, 2026 at 7:24 pm

    You could use codeignator with JQuery. Using JQuery, you load a url into an element, which could be a div as follows $(‘#element_id’).load(url).

    Note that you can replace #element_id with any valid css selector, or even use XPath.

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

Sidebar

Related Questions

My Basic Goal A Rails app that can load new content via Ajax while
How can I (if at all) load a new page when an html's selector
Apache Pig can load data from Hadoop sequence files using the PiggyBank SequenceFileLoader :
I have a web application that can load plugins through reflection. It currently uses
I have a CSV of file of data that I can load in R
I have a little problem with a Listview. I can load it with listview
I am trying to dynamicaly compile code using CodeDom. I can load other assemblies,
I currently have a page in which users can drag content around, resize it,
I have a page where i am generating random pages using php script and
I have tried a reference code from the web to load a particular element

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.