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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:09:37+00:00 2026-05-16T00:09:37+00:00

I use this code to load a htmlbox-instance to my page (this page also

  • 0

I use this code to load a htmlbox-instance to my page (this page also loads the necessary libraries to use htmlbox in the head-section):

<div id="container"></div>

<script language="Javascript" type="text/javascript">

 function showEditPnl() {
  var pnl = document.getElementById("container");

  if (window.XMLHttpRequest) {
   // code for IE7+, Firefox, Chrome, Opera, Safari
     xmlhttp=new XMLHttpRequest();
  } else {
   // code for IE6, IE5
     xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  xmlhttp.onreadystatechange=function() {
   if (xmlhttp.readyState==4 && xmlhttp.status==200) {
    pnl.innerHTML = xmlhttp.responseText;
   }
  };
  xmlhttp.open("GET","ajax_getEditor.html",true);
  xmlhttp.send();
 }
</script>

Here is the ajax_getEditor.html-file:

<textarea id='ha'></textarea>
<script language="Javascript" type="text/javascript">
$("#ha").css("height","100%").css("width","100%").htmlbox({
    toolbars:[["link","unlink","image"]],
 skin:"blue"
});
</script>

When i call the showEditPnl() method i see the textarea and the script in the page. but it seems like the script (loaded trough ajax) isn’t executed. When i copy the code from ajax_getEditor.html and place it in the container, all works fine. I’m sure this is a very basic problem, but i don’t know how to solve it..

  • 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-16T00:09:38+00:00Added an answer on May 16, 2026 at 12:09 am

    As the comments state, this is a result of using .innerHTML like you are currently, this answer is a bit tangential to the problem.

    You can use .load() here since you’re already including jQuery to simplify things a bit. You’d replace your current function with this:

    function showEditPnl() {
      $("#container").load("ajax_getEditor.html");
    }
    

    Or, you can run your script in the callback instead of loading it from the fetched page, like this:

    function showEditPnl() {
      $("#container").load("ajax_getEditor.html", function() {
        $("#ha").css({height:"100%", width: "100%"}).htmlbox({
          toolbars:[["link","unlink","image"]],
          skin:"blue"
        });
      });
    }
    

    In this case I’m also passing an object to .css() to reduce it to one call instead of two.

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

Sidebar

Related Questions

I use this code to load the content from a different page into the
When I load a page normally and use this code : $('#clientName').typeahead({ //removed options
I use this code to load a .Net assembly to PowerShell: [System.Reflection.Assembly]::Load(System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
I use this code to load an Excel file into a datatable: public static
I use this code below to load CSS files. var i, a; for(i=0; (a
I use this code to load an image into matlab axes in gui :
I use this code to load YouTube Videos in an activity that supports it
I use this line of code to load a local html file into a
I'm trying to trim and shorten some HTML. I use this code: $(window).bind(load, function()
I use this code to load data and convert them to a type that

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.