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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:19:51+00:00 2026-05-31T19:19:51+00:00

Any help at all is appreciated here folks. I’m building a web app in

  • 0

Any help at all is appreciated here folks. I’m building a web app in php and I’m using the Yii MVC framework which has a lot of built in tools. Just as the title says, i need to refresh a div every 10 seconds. At the moment I have this ajax function

<script type="text/javascript">
    function ajaxFunction(){
    var ajaxRequest;  

    try{
        // Opera 8.0+, Firefox, Safari
        ajaxRequest = new XMLHttpRequest();
    } catch (e){
        // Internet Explorer Browsers
        try{
            ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try{
                ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e){
                // Something went wrong
                alert("Your browser broke!");
                return false;
            }
        }
    }
    // Create a function that will receive data sent from the server
    ajaxRequest.onreadystatechange = function(){
                var list = document.getElementById('logged_in_users_list');
        if(ajaxRequest.readyState == 4){
            list.innerHTML = ajaxRequest.responseText;
                        setTimeout('ajaxFunction()',10000);
        }
    }
    ajaxRequest.open("GET", "protected/controllers/room/openRoom", true);
    ajaxRequest.send(null);
}
</script>


<script type="text/javascript">
            setInterval(function() {ajaxFunction();}, 5000);
</script>

For those of you who are unfamiliar with Yii it stores most of your php files in a folder called protected. Well it is just that, the ajaxRequest.open line of code above is requesting that url which is stored inside the protected folder, so I keep getting an access forbidden 403 error. Any ideas how I could implement something different with jquery or get round this access problem?

  • 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-31T19:19:52+00:00Added an answer on May 31, 2026 at 7:19 pm

    Usin jquery

    $(function() {
        function callAjax(){
            $('#myDiv').load("http://yourdomain.com");
        }
        setInterval(callAjax, 5000 );
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any help here would be greatly appreciated. I have this table hospital Nurse |
Any help is appreciated. When using cfimage to generate a captcha, we keep his
Any help with this problem would be fantastic. I appreciate all contributions! Let us
I'm very new to C++ and would really appreciate any and all help. I
Any help would be appreciated, I'm trying to convert the code below to C#,
Any help most appreciated, this is driving me insane. I'm doing exactly what I
Any help would be appreciated. I am looking for a way to programatically notified
Here's the problem folks I'm using a Telerik RadGrid. Within is a FormTemplate with
This is driving me crazy, so any help will be appreciated. I am developing
Code can be found here: http://www.myhorizon.ca/client_central/sortable_test.php Hello folks of Stackoverflow, I have a list

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.