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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:28:39+00:00 2026-05-26T19:28:39+00:00

I have a page. In that page’s header i have all of my javascript.

  • 0

I have a page. In that page’s header i have all of my javascript. In the pages body i have a link that calls an ajax http request (i use long hand xhr not jquery) and that request pulls a php form on to my page.

That form has some select dropdowns that are formatted/styled using jquery. The problem i am having is that when i put the form directly in the page the select is formated fine on page load. But when i remove the form from the page and pull it in using ajax it is as if the javascript is not loading.

So the javascript is loading when the page loads but when i pull in the php form onto the page via ajax the javascript is not working. the select dropdown is not formated/styled. It’s almost like the javascript needs to reload or something.

I am not using jquery to make the call. I am just using long hand ajax.

function getPage(str)
 {
 if (str=="")
   {
   document.getElementById("center").innerHTML="";
   return;
   } 
if (window.XMLHttpRequest)
   {// code for IE7+, Firefox, Chrome, Opera, Safari
   xmlhttp=new XMLHttpRequest();
   }
 else
   {// code for IE6, IE5
   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
 xmlhttp.onreadystatechange=function()
   {
   if (xmlhttp.readyState==4 && xmlhttp.status==200)
     {
     document.getElementById("center").innerHTML=xmlhttp.responseText;
     }
   }
 xmlhttp.open("GET","xhr_php/get_page.php?page="+str,true);
 xmlhttp.send();
 }
  • 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-26T19:28:40+00:00Added an answer on May 26, 2026 at 7:28 pm

    The jquery styling script runs, then it is done. If you want it to run again after your ajax call, put it in a function and call the function on success.

    function dostuff() 
    {
        $('selector').css('var', 'val');
    }
    

    The success case is when status==200 and readyState==4, fire your js css tweaks in there after you’ve inserted the HTML response.

    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            document.getElementById("center").innerHTML=xmlhttp.responseText;
            dostuff();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that consists of a header div for navigation, a content
I have a page that I am using an Ajax Accordion and when I
I have a page that looks like this: Head and body tags... <form runat=server>
I have page A that issues an ajax call and brings in snipped B.
I have a page that has a header, content, and footer. The header and
I have page that creates a table: http://gupii.co.uk/rap/weekTable.php and I'm using a plugin to
I have a page that includes javascript which I only want to run under
We have a page that makes a request to a 3'rd party web service.
I have page that possibly calls this line. jQuery.ajaxSetup({async:false}) In another function I would
hi all i have page that has two buttons, one should allow the person

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.