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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:36:25+00:00 2026-06-09T15:36:25+00:00

I am trying to get the following to work. I have this code in

  • 0

I am trying to get the following to work. I have this code in my footer file:

footer.php:

<script type="text/javascript">
$(document).ready(function(){
$.ajax({ 
url: '', 
type: 'GET', 
dataType: "script",
success: function(data){ 
  //data is returned back 
  $('#latestforumposts').html(data); 
} 

});

}); 
</script>

And this is the file forumposts.php:

<script type="text/javascript" src='http://www.habboxforum.com/external.php?forumids=1382,1384,4,5,14,1410,7,85,40,43,124,123,24,30,306,34,446,38,214,1409,249,767,69,71,73,134,56,45,1230,54,135,1424,1425,601,893,209,1086&type=js'></script>

<script type="text/javascript">
<!--
for (x = 0; x < 5; x++)
{
document.writeln("<tr class='forumnewposts'><td><div class='forumpostwidth'><a target='_blank' href='http://www.habboxforum.com/showthread.php?t="+threads[x].threadid+"'>"+threads[x].title+"</a></div></td><td><div class='forumuserwidth'>"+threads[x].poster+"</div></td></tr>");
}
//-->
</script>

Basically, the file doesn’t seem to load in to the div #latestforumposts like it is meant to yet if you visit the forumposts.php page directly it shows the content like it is supposed to (eg the script in forumposts.php works).

How can I drag that script and place it in a div on my page. The reason I need to do this is I need it to auto-refresh every x number of seconds.

UPDATE:

Okay, so I now have the following code in my footer:

<script type="text/javascript" src="http://www.habboxforum.com/external.php?forumids=1382,1384,4,5,14,1410,7,85,40,43,124,123,24,30,306,34,446,38,214,1409,249,767,69,71,73,134,56,45,1230,54,135,1424,1425,601,893,209,1086&type=js"></script>
  <script type="text/javascript">
$(document).ready(function(){
$.ajax({ 
url: '', 
type: 'GET', 
dataType: "html",
success: function(data){ 
  //data is returned back 
  $('div#latestforumposts').html(data); 
} 

});

}); 
</script>

This now loads the script but instead of displaying the html that is loaded in to the div#latestforumposts it just refreshes the whole page content with it. Any idea why it doesn’t load in to the div?

  • 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-09T15:36:26+00:00Added an answer on June 9, 2026 at 3:36 pm

    jQuery

    $(document).ready(function()
    {
        update(false);
    });
    
    function update(load)
    {
        if(load)
        {
            $.get(url,function(data)
            {
                $('#latestforumposts').html(data); 
            });
        }
    
        setTimeout(function(){update(true)},5000);
    }
    

    PHP (/forumposts.php)

    <script type="text/javascript" src="http://www.habboxforum.com/external.php?forumids=1382,1384,4,5,14,1410,7,85,40,43,124,123,24,30,306,34,446,38,214,1409,249,767,69,71,73,134,56,45,1230,54,135,1424,1425,601,893,209,1086&type=js"></script>
    <script type="text/javascript">
        for(x = 0; x < 5; x++)
        {
            $('#new_posts tbody').append('<tr class="forumnewposts"><td><div class="forumpostwidth"><a target="_blank" href="http://www.habboxforum.com/showthread.php?t='+threads[x].threadid+'">'+threads[x].title+'</a></div></td><td><div class="forumuserwidth">'+threads[x].poster+'</div></td></tr>');
        }
    </script>
    <table id="new_posts"><tbody></tbody></table>
    

    HTML

    <div id="latestforumposts"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get the following code to work: if (isset($_POST['file'])){ if(file_exists($_POST['file'])){ echo
I have been trying to get the following code to work(everything is defined in
I'm trying to get the following code to work using both Watin and HttpWatch.
I'm trying to get HTML5's audio tag to work in Chrome. The following code
I am trying to get this to work I am using this code and
I have been trying to get the following code working. It's a progress bar
Im trying to get selectOneMany to work with limited success. I have the following
Having issues trying to get this jquery code to work. The idea is that
I am trying to get the following regex to work on ios in order
I'm trying to get the following regex to work on my String: Pattern Regex

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.