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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:53:51+00:00 2026-06-04T01:53:51+00:00

Is this possible? I inserted a simple test snippet like this <script type=text/javascript>//<![CDATA[ document.write(‘foo’);

  • 0

Is this possible?

I inserted a simple test snippet like this

<script type="text/javascript">//<![CDATA[ 
document.write('foo');
//]]></script> 

but it does nothing. ( W3 schools suggest the use of CDATA here, but this did not help ).

To reiterate this snippet was written into the .innerHTML property of the body tag.

I’ve seen some mentions of eval() on google but not too sure if this is relevant or good practice?

Wrapping the code in eval like they do here at W3 has no effect.

  • 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-04T01:53:52+00:00Added an answer on June 4, 2026 at 1:53 am

    Javascript is only executed on first read, not when it is dynamically inserted as such. You would have to use something like the eval() function to execute the content of the actual script. You could also use DOM functions like getObjectsByTagName() to grab the script tag, and get its contents from there.

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

Sidebar

Related Questions

This is for Play! Framework 2.0. I'm trying to write a simple test case
if this possible to write a com control or activex in C# and use
Is this possible in any way? My project folder structure looks like this: my_project:
imagine you have simple page like this: Hi everybody. when you click here new
Question: Is it possible to include some type of character (like \r or \n,
I don't know if it is possible to do this. I would like to
Is this possible? I am creating a single base factory function to drive factories
Is this possible? I've followed the instructions from here ( http://www.jetbrains.net/confluence/display/TCD4/Setting+up+an+External+Database#SettingupanExternalDatabase-MicrosoftSQLServer2005 ) but I
Is this possible: myList = [] myList[12] = 'a' myList[22] = 'b' myList[32] =
Is this possible? example: $('a.change').click(function(){ //code to change p tag to h5 tag });

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.