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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:10:23+00:00 2026-06-05T09:10:23+00:00

This question continues on from this question: Read url and output new javascript src

  • 0

This question continues on from this question:

Read url and output new javascript src

My latest code is:

$(document).ready(function () {


        var oScript = document.createElement('script');
        oScript.type = 'text/javascript';
        oScript.src = 'converter.js';

        // most browsers
        oScript.onload = function () {
            $('#converter #form').load(renderConverter());
        } 

        // IE
        oScript.onreadystatechange = function () {
            if (this.readyState == 'complete') {
                $('#converter #form').load(renderConverter());
            }
        }

        document.body.appendChild(oScript);

});

The issue is on .load(renderConverter());. What this does is, it removes the entire DOM and prints what renderConverter(); asks it to print.

The function renderConverter(); uses the following to print the html:

window.document.write(html);

I changed to:

document.write(html) but it does the same thing.

How can I force it to only print within the div I have run the call back on?. The div being #converter #form.

  • 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-05T09:10:24+00:00Added an answer on June 5, 2026 at 9:10 am

    You cannot use document.write after the page has finished loading.

    You should use jQuery DOM manipulation instead.

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

Sidebar

Related Questions

This is the continual question from this previous question I've asked: Change Database Column
And my confusion with JSF continues. This is a continuation of a question asked
(This question is a follow up from Safari Scrollbars & SVG - the workaround
This question is about tidying up code and better management of said code butI'm
This maybe a continuation from 2 of my previous question, or maybe it's a
I'm new to FFMpeg so this may be a dumb question, but I don't
A question to windows network programming experts. When I use pseudo-code like this: reconnect:
I read this question about the error that I'm getting and I learned that
This question is just to clear some things up. Some things like this have
This question is so basic, I'm certain in must be a duplicate of something

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.