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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:47:32+00:00 2026-05-26T10:47:32+00:00

I have a small page: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd> <html>

  • 0

I have a small page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title></title>
  <script type="text/javascript" src="jquery-1.4.2.js"></script>
  <script type="text/javascript" src="temp.js"></script>
</head>
<body>
<p>foo</p>
<p>bar</p>
</body>
</html>

and I’m trying to load two different versions of jQuery:

// temp.js
jQueryScriptOutputted = false;
initJQuery = function() {

  //if the jQuery object isn't available
  if (typeof(myjQuery) == 'undefined') {

    if (!jQueryScriptOutputted) {
      //only output the script once..
      jQueryScriptOutputted = true;

      //output the script (load it from google api)
      document.write("<script type=\"text/javascript\" src=\"jquery-1.6.4.js\"></script>");
      document.write("<script type=\"text/javascript\">var myjQuery = $.noConflict(true);</script>");
    }
    setTimeout("initJQuery()", 50);
  } else {
    myjQuery(function() {
      // Check jQuery versions
      console.log('myjQuery version = ' + myjQuery().jquery);
      console.log('$ version = ' + $().jquery);
      console.log('jQuery version = ' + jQuery().jquery);

      // Get the data of the actual poll
      document.write("Where is foo and bar?!?");
    });
  }

}
initJQuery();

but it seems that this loads two different documents. I mean, when you open the page, the paragraphs get lost. How come?!?

  • 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-26T10:47:32+00:00Added an answer on May 26, 2026 at 10:47 am

    Calling document.write after the page has loaded will overwrite the entire page with the document.write parameter. Consider using something else like $().append or $().html to change the markup.

    i.e.

    myjQuery(function() {
          $('body').append("<p>Where is foo and bar?!?</p>");
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page(imaginary page resembling to original) <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
i have a small html page in the following format <html> <head></head> <body> <div
I have a .Net application that dynamically creates a small HTML page and pops
Have small web page at www.peterbio.com/mom/test.htm Someone wrote the code with mouse over and
I have developed a small administration page for game servers which you can add/remove/edit
i have a small problem, i am creating a edit page in my asp.net
I have a page that uses jQuery with a small glitch. I managed to
I have some text on a page that is small but readable in Chrome/Safari
I have an odd problem. Basicly my page works fine however after a small
I have small page, it looks follows: Some header Label with text only for

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.