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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:57:17+00:00 2026-06-05T00:57:17+00:00

I previously had this problem with an external file not running. I fixed this

  • 0

I previously had this problem with an external file not running.

I fixed this by loading the file dynamically instead…i.e. creating the element in JavaScript and linking to it via the .src attribute ( did this instead of using a scrip tag in the html ). Do I need to do something similar here?

Here is the embedded JavaScript I need to run that is inserted via .innerHTML of the body. Currently it is just “dead code” in my page. Note the json I’m passing in as the second variable to the set function. This is PHP composed and passed to the client via ajax POST.

<script type='text/javascript'>new Arc.Shared().set( 'tweet_data', [{"id":"1","0":"1","picture":"0","1":"0","name":"Test Account","2":"Test Account","tweet":"Hi","3":"Hi","time":"1338559048","4":"1338559048"},{"id":"1","0":"1","picture":"0","1":"0","name":"Test Account","2":"Test Account","tweet":"hi","3":"hi","time":"1338558809","4":"1338558809"},{"id":"1","0":"1","picture":"0","1":"0","name":"Test Account","2":"Test Account","tweet":"<a class=\"bookmark_tweet\" target=\"_blank\" href=\"http:\/\/ebay.com\">ebay <\/a>","3":"<a class=\"bookmark_tweet\" target=\"_blank\" href=\"http:\/\/ebay.com\">ebay <\/a>","time":"1338504456","4":"1338504456"},{"id":"1","0":"1","picture":"0","1":"0","name":"Test Account","2":"Test Account","tweet":"foo","3":"foo","time":"1338504225","4":"1338504225"},{"id":"1","0":"1","picture":"0","1":"0","name":"Test Account","2":"Test Account","tweet":"foo","3":"foo","time":"1338504222","4":"1338504222"},{"id":"1","0":"1","picture":"0","1":"0","name":"Test Account","2":"Test Account","tweet":"foo","3":"foo","time":"1338504220","4":"1338504220"},{"id":"1","0":"1","picture":"0","1":"0","name":"Test Account","2":"Test Account","tweet":"foo","3":"foo","time":"1338504217","4":"1338504217"}] );</script>

Notes:

Alternative to Eval Snippet:

var myCode = 'alert("Howdy?");';
 var myFucn = new Function(myCode);
 myFucn();
  • 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-06-05T00:57:20+00:00Added an answer on June 5, 2026 at 12:57 am

    Another way per Why doesn't embedded JavaScript execute when inserted in response to an ajax call?

    Here is the append child method…that take ajax responseText and appends it into the DOM.

    function onSuccess() {
        src = document.createElement('script');
        src.innerHTML = this.responseText;
        document.body.appendChild(src);
    }
    

    Third way is to have an external element trigger it per here:

    Executing <script> elements inserted with .innerHTML

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

Sidebar

Related Questions

I am having a curious problem. I had this Java application which was previously
I am working on this problem and had previously asked related question. Implementation of
I previously had a post on this issue that was resolved. However since rebuilding
If this was previously talked about, I'm sorry, I had a hard time searching
previously i had custom tableviewcell and was loading from Nib.in that i have specified
I'm seriously about to stop coding and become a carpenter. This problem has had
previously i had error in installing apache2 for python, this is the link I
I have this problem where all URLs like context/path/file/anything/that/follows becomes context/path/file.php/anything/that/follows or context/path/file.xml/anything/that/follows .
I'm in a curious situation where I previously had no problem achieving what I'm
I previously had Passenger 2.2.13 install with NGINX 0.7.65 - I want to install

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.