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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:43:20+00:00 2026-06-11T18:43:20+00:00

I am attempting to load dynamic data based on the specific URI segment thats

  • 0

I am attempting to load dynamic data based on the specific URI segment thats on the page.

Heres my Javascript:

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

    $('#topics_form').submit(function() {
        var topic = document.getElementById('topics_filter').value
        $.ajax({
            type: "POST",
            url: 'ajax/update_session_topic',
            dataType: 'json', 
            data: { topic: topic },
                success: function(){
                    load_custom_topics()
                }
        });
        return false;
    });

    function load_custom_topics(){
        $.ajax({
        type: "POST",
        url: 'ajax/load_custom_topics',
        dataType: 'json',
        data: {},
                success: function (html) {
                    $('div.topics_filter').html(html['content']);
                    get_threads();
                }
        });
    }

    function get_threads(){
        var page = document.getElementById('page').value
        $.ajax({
        type: "POST",
        url: 'ajax/get_threads',
        dataType: 'json',
        data: {page: page},
            success: function (html) {
                $('div#thread_list').html(html['content']);
            }
        });
    }
});

So, as you can see, on page load, it kicks off load_custom_topics which runs just fine. Its then supposed to call get_threads(). This is where the thing stops, and I get no data.

Get_threads()

public function get_threads()
{
    $session = $this->session->userdata('active_topic');
    if ($this->input->post('page') == '1')
    {
        $data['list'] = $this->right_model->thread_list_all();
        $data['test'] = "all";
    } else {
        $data['list'] = $this->right_model->thread_list_other($session);
        $data['test'] = "not all";
    }
    if ($data['list'] == FALSE)
    {
        $content = "no hits";
    } else {
    $content = $this->load->view('right/thread_list', $data, TRUE);
    }
    $data['content'] = $content;
    $this->output->set_content_type('application/json')->set_output(json_encode($data));
}

While I create the ‘page’ dynamically, the HTML outputs to this:

<div name="page" value="1"></div>

Any reason why get_threads() is not running?

  • 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-11T18:43:22+00:00Added an answer on June 11, 2026 at 6:43 pm

    This does not have an ID. It has a name.

    <div name="page" value="1"></div>
    

    This means that your request for getElementById is failing. So this line of code should be showing a TypeError in your console.

    var page = document.getElementById('page').value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to load some json data into a custom JQuery function. There
I am attempting to load some images into a very basic C++/SDL based program.
I'm attempting to just change the background colour of a webpage upon page load.
I'm attempting to load data from an undocumented API (OsiriX). Getting the NSManagedObject like
I am attempting to load document files into a document library in SharePoint using
I am attempting to load data from a *.csv file off my VM of
I'm attempting to load google maps in an anonymous function but am getting a
I'm attempting to load numerical data from CSV files in order to loop through
I am attempting to load user data into an Ubuntu 12.04 LTS AMI (ami-a29943cb,
So basically I am thinking about attempting load testing on my asp.net application using

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.