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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:36:14+00:00 2026-05-20T09:36:14+00:00

Im using jquery to call a page via ajax. I have some jquery functions

  • 0

Im using jquery to call a page via ajax. I have some jquery functions that load inside the returned html from the page being called from ajax. The problem is Im trying to include the js file inside the returned data, it gives back the html but seems to strip the script tag:

    function buildDisplayResults()
    {
         $.ajax({
             method: 'get',
             cache: false,
             url : '/display_results.php',
             dataType : 'text',
             success: function (text) { $('#showresults').html(text); }
         });

    }

The returned data I have <script src="/js/display.js"></script>

That script code above always gets stripped out, but I need it in the returned data so the functions work inside the data the ajax call sends back. Any ideas?

  • 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-20T09:36:14+00:00Added an answer on May 20, 2026 at 9:36 am

    As far as I can tell, it should work; it must be something else in your environment or in the markup you’re fetching. I’ve tested it and have it working on IE6, IE7, IE8, Chrome 9 on Linux and Windows, Firefox 3.6 on Linux and Windows, and Opera 11 on Linux and Windows; all using jQuery 1.5:

    Ajax call on main example page:

    $.ajax({
      url: "/okuli4/3",
      dataType: "text",
      method: "get",
      cache: false,
      success: function(data) {
        $('#target').html(data);
      },
      error: function(xhr, status, err) {
        $("<p>Error: Status = " + status + ", err = " + err + "</p>")
          .appendTo(document.body);
      }
    });
    

    …where the /okuli4/3 resource looks like this:

    <p>I'm the snippet.</p>
    <script type='text/javascript' src='/etobe4/2'></script>
    <p>I'm the snippet after.</p>
    

    …where the /etobe4/2 resource looks like this:

    jQuery("<p>I was added by the external script file.</p>").appendTo(document.body);
    

    Live example

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

Sidebar

Related Questions

How would you access the cache from a jQuery ajax call? I'm using jquery
I am using jQuery and JavaScript, I need to call the jQuery function inside
I am trying to pass a dataString to to an ajax call using JQuery.
I am using jQuery. I call a JavaScript function with next html: <li><span><a href=javascript:uncheckEl('tagVO-$id')>$tagname</a></span></li>
Help! I am using jQuery to make an AJAX call to fill in a
I'd like to call a .net webservice from another domain using only jquery. What
I am using .Net framework 2.0 / jQuery to make an Ajax call to
I am using the $.ajax function in jquery to make a call to an
Using jQuery , how can I dynamically set the size attribute of a select
Using jQuery, how do you bind a click event to a table cell (below,

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.