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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:07:42+00:00 2026-05-26T22:07:42+00:00

Or any other tags :) for eg. <head> <title>page…</title> <script> var a = ‘abc’;

  • 0

Or any other tags 🙂

for eg.

  <head>
    <title>page...</title>
    <script> var a = 'abc'; </script>
    <script src="foo.js" type="text/javascript"></script>
  </head>
  <body>
    ...
    <script src="foo2.js"></script>
  </body>

(this string is a response from a ajax call)

I want to get a array with 3 strings:

  1. <script> var a = 'abc'; </script>
  2. <script src="foo.js" type="text/javascript"></script>
  3. <script src="foo2.js"></script>

How can I do that?

  • 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-26T22:07:43+00:00Added an answer on May 26, 2026 at 10:07 pm

    Define: outerHTML function (taken from here)

    jQuery.fn.outerHTML = function(s) {
    return (s) ? this.before(s).remove() : jQuery("&lt;p&gt;").append(this.eq(0).clone()).html();
    }
    

    Then assume your response is stored in data you can do:

    $(data).filter("script").each( function(e) { 
        // do something with $(e).outerHTML()
    } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My code: <head> <script src=/static/jquery-1.7.1.min.js type=text/javascript></script> <script type=text/javascript> var value = jQuery('#continue').attr('value'); alert(value); </script>
Is there any other better way to fill up the array like : var
Is there any other command for redirecting a controller to a particular view page
Is there any reason why registering a javascript file from the head tags of
I've a page in an ASP.net site where i've multiple content placeholders, script tags
I'm aware of dynamic script/css loading by adding <style> or <link> tags to head
Or any other normal scripting language for that matter. I know there is VBScript
Are there any other similar packages that help identify and provide capabilities for browser
Without using any other jquery plugin I'm looking to continuously flash/change a div's border
How can Mercurial (or any other DVCS) recognize partially overlapped histories? E.g. fine grain

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.