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

  • Home
  • SEARCH
  • 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 6535459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:22:35+00:00 2026-05-25T10:22:35+00:00

I am using jQuery.ajax to call a script that renders results to html snippet

  • 0

I am using jQuery.ajax to call a script that renders results to html snippet and it is loaded into a div, something like this:

jQuery.ajax({type:'POST',data:{'var': '1'}, url:'/some/script',success:function(data,textStatus){jQuery('#myDiv').html(data);}});

Script executes and page loads into my div. The problem / dilemma that I have is that my parent page (the page I call ajax from) has a few jquery scripts included in the header, that are run on page load, for example date picker, labelify, ui.selectmenu select box and a few more. However, once my child page loads it does not inherit styles/functionality applied by those scripts. I understand that it is because those scripts are executed on parent page load and are not triggered when child page loads. Questions:

  1. Should a child HTML page be a complete HTML page with its own header and body and include all the needed scripts, even though same scripts are being included in the parent. (right not child page is just an html snippet)

  2. If It should not be a complete HTML page, then should I include all my scripts anyways in the body of the child page (html snippet)

  3. Is there an easy way to trigger all jquery parent scripts on child load. Basically faking page load for parent.

Any other ideas suggestions?

Thanks!

  • 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-25T10:22:35+00:00Added an answer on May 25, 2026 at 10:22 am

    If you put the script you want running in a document onload inside your included file, it will run with the parent’s scripts when the content is loaded in.

    Make a new file with this in it, and load it in to your parent file to see. Don’t include the jQuery script in the child file, so it doesn’t have access to the $(document) on its own.

    <script type="text/javascript">
    $(document).ready(function(){
        alert('a');
    });
    </script>
    

    To make any run-on-load-code from the parent apply to the child, you’ll probably have to create a function that does everything in the parent, and allow the child to call it when it loads in.

    Current parent:

    <script>
        $(document).ready(function(){ doSomething(); doSomethingElse(); });
    </script>
    

    becomes…

    <script>
        $(document).ready(function(){ loaded(); });
        function loaded () { doSomething(); doSomethingElse(); }
    </script>
    

    Then in the child, it calls $(document).ready(function(){ loaded(); }); as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am loading feed-items into a ul using this jQuery .ajax() call, which I
Quick question: I'm using jquery ajax to call a page that returns some json
I have a script that calls a php page via jquery/ajax. The results would
How would you access the cache from a jQuery ajax call? I'm using jquery
I'm using jQuery to make an Ajax call using an Http Post in ASP.NET
I am using jQuery to make an AJAX call to a ruby method in
I'm using JQuery to make an Ajax call. I used a sniffer to catch
I am trying to pass a dataString to to an ajax call using JQuery.
Help! I am using jQuery to make an AJAX call to fill in a
I trying to make my first AJAX with JSON call using jQuery and CodeIgniter.

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.