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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:24:02+00:00 2026-05-23T12:24:02+00:00

I had a home page which have a few tables that refresh itself every

  • 0

I had a home page which have a few tables that refresh itself every few sec.

Below is the code for the jquery in view file (inside_view.php)

<script>
 $(document).ready(function() {
     $("#encontainer").load("inside/home_en");
   var refreshId = setInterval(function() {
      $("#encontainer").load('inside/home_en?randval='+ Math.random());
   }, 9000);
   $.ajaxSetup({ cache: false });
});

</script>
<div id="encontainer"></div>

and here is the controller code (inside.php)

function index(){
  // Write to $title
  $this->template->write('title', 'Update to date data');
  $this->template->write_view('header', 'header_content', true);
  // Write to $content
  $this->template->write_view('content', 'inside_view', true);
  // Write to $sidebar
  $this->template->write_view('sidebar', 'user_side_menu');
  // Load and display the template
  $this->template->load();
}

function home_en(){
 //look latest enquirer data
 $data['enresults'] = $this->customer_model->get_cp_list(5);
 $this->load->view('ajax_home_en',$data);
}

here is the (ajax_home_en.php) code

<link type="text/css" rel="stylesheet" href="http://bravonet.my/tombocrm/assets/css/table.css" />  
<?php if($enresults->num_rows() == 0){
    echo 'No data result, please insert one';
}else{
?>
 <table width="100%">
    <tr>
        <th>CP code</th>
        <th>Code</th>
        <th>Name</th>
    </tr>
    <?php foreach($enresults->result() as $row){
         echo  '<tr class="tr'. alternator('1', '2'). '">';
        ?>
        <td align="center"><?php echo $row->cp_code?></td>
        <td align="center"><?php echo $row->en_code?></td>
        <td align="center"><?php echo $row->name?></td>
        <td align="center"><?php echo anchor('customers/patient_update_view/'.$row->eid,'Edit');?></td>
        <td align="center"><?php echo anchor('customers/cp_details_view/'.$row->cpid,'View');?></td>
    </tr>
    <?php }?>
</table>
<?php 
echo anchor('customers','View all data');
} ?>

Everything is fine when i try to view this page with this url
http://mysite.com/inside

but once i type this url
http://mysite.com/inside/ or this http://mysite.com/inside/index

the

<div id="encontainer"></div>

show inside() view instead of home_en() view. n will have continuous page refreshing in the box (and makes my IE stop responding).

I don’t understand why adding a “/” or /index in the URL will cause such bug, is my javascript appear error?

thx in advanced!

  • 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-23T12:24:03+00:00Added an answer on May 23, 2026 at 12:24 pm

    It might be an issue with relative links, try:

    $(function() {
         $("#encontainer").load("/inside/home_en");
       var refreshId = setInterval(function() {
          $("#encontainer").load('/inside/home_en?randval='+ Math.random());
       }, 9000);
       $.ajaxSetup({ cache: false });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function which wanders through the elements in a page and adjusts
I have this jQuery plugin called Easy Slider which I'm implementing on this site
I have a hefty PHP script. So much so that I have had to
I have a long complicated home page where a company is shown, for each
I had a discussion with some colleagues mentioning that there are not too many
I had to delete all the rows from a log table that contained about
I had the idea of a search engine that would index web items like
I have a website that I made and I am planning to redo it.
I had created my website on localhost under a subdirectory joomla. Now I have
We have an ASP.NET application that uses Forms Auth. When users log in, a

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.