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

  • Home
  • SEARCH
  • 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 8835669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:18:41+00:00 2026-06-14T09:18:41+00:00

I am using Codeigniter with Zurb Foundation framewrk. i am tryin to load data

  • 0

I am using Codeigniter with Zurb Foundation framewrk. i am tryin to load data in reveal box(fancy popup) using AJAX.. The trick is, i am not loading just the inner html content, but the HTML itself..I mean, i want the function in controller to return the php file to ajax calling function whose contents will be displayed in popup.. My code is

Ajax function call

function ajaxfunct() {
            $.ajax({
                type: "POST",
                url: "welcome/test",
                data: { name: "Jigar", location: "jain" }
            }).done(function( html ) {
                $("#tagUser").append(html);


            });
        }

My Controller Code is

public function test() {
    $data['name'] = $_POST['name'];
    $data['location'] = $_POST['location'];
    $this->load->view('index', $data);
    echo 'WHAT SHUD I ECHO HERE ?'
}

I know the last 2 lines of my Controller code is wrong..I just dont know how to fetch a php file from views folder, process it and pass it to ajax as a pre-processed html(string).

I am not looking for entire code..just a reference to some function or online tutorials will be great..
thanx

  • 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-14T09:18:42+00:00Added an answer on June 14, 2026 at 9:18 am

    You already do fetch a PHP file from your views folder in your Controller.

    The line

    $this->load->view('index', $data);
    

    Loads the /application/views/index.php file and processes it with data from the $data array.

    So for Your AJAX call you could make a different view file than index.php like test.php that contain the proper HTML for the AJAX and call it with the line

    $this->load->view('test', $data);
    

    And skip the ECHO part…

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

Sidebar

Related Questions

I have been using CodeIgniter all these while, and have solid foundation in OOP
Using Codeigniter, any numeric data returned from my MySQL database is returned as strings.
I am using codeigniter while i am importing table data row by row to
I'm using CodeIgniter, and I'm not able to use my database with it. I'm
I'm using CodeIgniter 2.1 I use CodeIgniter's session to handle whether a user logged
I am using CodeIgniter to upload some files through a form. I know how
I'm using CodeIgniter + Zend libraries. I want to let users upload videos to
I'm using codeigniter framework and I'm getting this error when I've submitted my form:
i am using Codeigniter i am facing an issue while setting the values of
I am using Codeigniter framework and I have a form with input fields. When

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.