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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:45:58+00:00 2026-05-31T11:45:58+00:00

this problem is driving me crazy… I’m calling a PHP file through Ajax and

  • 0

this problem is driving me crazy… I’m calling a PHP file through Ajax and parse it into my HTML content. I have to do it that way to have dynamic content, without refreshing the page.

My problem is that the parsed code won’t execute any jquery stuff. I need a Jquery slider for example in the PHP file. But it’s parsed as normal HTML and JQuery doesn’t seems to recognise it.

Here’s a sample:

The HTML File:

<html>
    <head>
        <script src="jquery-1.7.1" type="text/javascript"></script>
        <script src="jscroller-0.4.js" type="text/javascript"></script>

        <script type="text/javascript">
            $(document).ready(function()
            {
                // Add Scroller Object
                $jScroller.add("#scroller_container","#scroller","right",1);
                // Start Autoscroller
                $jScroller.start();
            });
        </script>


        <script type="text/javascript">
            function showGet(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("content").innerHTML=xmlhttp.responseText;
                }
            }

            xmlhttp.open("GET","content.php?q="+str,true);
            xmlhttp.send();
            }
        </script>
    </head>

    <body>
        <div id="content">
            <input type="button" onclick="showGet(1)" value="showGet">
        </div>

        <div id="scroller_container">
         <div id="scroller">
          ...[Content]...
         </div>
        </div>
    </body>
</html>

Here’s the content.PHP file:

<?php

    echo "
        <div id=\"scroller_container\">
            <div id=\"scroller\">
                ...[Content]...
            </div>
        </div>
        "

?>

Executed, the HTML has a Button. If you click the button, it parses content.php into the <div id="content></div>.
The PHP contains the same <div id="scroller" .... as the HTML.

The HTML div works, the one in the PHP file not. WHY???? and how do I get it to work?

Many thx in advance for all hints!!

  • 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-31T11:45:59+00:00Added an answer on May 31, 2026 at 11:45 am

    Loading content using jQuery ajax can be as simple as the following using load() method:

    http://api.jquery.com/load/

    /* loads a file into id=content and replaces exisitng html*/
    $('#content').load( 'path/to/server/file', function(){
        /* new content exists, intialize event handling 
        and plugins for new html here*/
    
    
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, this is an embarassingly simple-looking problem, but is driving me crazy. I'm learning
This problem is driving me crazy, I'm sure I'm missing something. I need to
This problem is driving me crazy because I am not sure why this just
This problem is driving me a bit crazy. The code seems to be segmentation
This is driving me crazy, I just can't find out the problem: I have
I'm running into a little problem that's driving me crazy, and I'd welcome any
This is driving me crazy. Very grateful if someone could help me out! Problem:
This problem has been driving me crazy and Monday mornings don't really help. I'm
This problem is driving me crazy. I have the following code: 'unprotect sheet If.Range(Start).Row+1<.Range(End).Row
I've run into a problem that's driving me crazy. In my application (ASP.NET MVC2

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.