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

  • Home
  • SEARCH
  • 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 8411549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:26:54+00:00 2026-06-10T00:26:54+00:00

I posted quite recently about an issue with javascript in firefox, and it was

  • 0

I posted quite recently about an issue with javascript in firefox, and it was denoted the problem was likely document.write() overwriting the script somehow. It was suggested I use IDs to solve the problem of both overwriting the script and to avoid stacking of the information.

However, on trying to implement the IDs into my javascript and html code, I found that firebug reports that:

"TypeError: document.getElementById("author_container") is null"

Despite the fact, that, once again, the ID is already defined under:

<p id="author_container"></p>

And there are clearly no typos, and re-arranging the script into the head section or altering it so the p occurs before the script makes absolutely no difference. (Note the other example runs fine despite the script occurring first).

If I use a pre-existing example of an ID and getElementById and run it in firefox, it runs fine:

http://pastebin.com/FTEX1HGE

But if I try to run my code, which doesn’t seem that majorly different, I run into issues:
http://pastebin.com/XfGUpZAS

Am I missing something here? How do I alter the code to make it work in firefox? Will firefox allow me to ever run my code correctly? (Find out next week?)

  • 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-10T00:26:55+00:00Added an answer on June 10, 2026 at 12:26 am

    Place your script at the bottom of the page, right before the closing </body> tag. In other words, make the script tag the last one of document.body. That way the DOM-tree is completely loaded before the scripting starts.

    Aside from a number of issues, the real issue is the document.open statement in the GenerateCoord function. That clears the complete document, after which – indeed – no element is left to get by any Id. Here’s a jsfiddle without it.

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

Sidebar

Related Questions

First of all: A quite similar problem has been posted and somehow solved already,
Recently I posted a answer to a question that I thought was quite an
I posted a question about keys yesterday, and got very helpful responses. I've been
I posted a question last night about Java Reflection and am discovering compiler warnings
[cross posted again to Mahalo answers] My Perl/Tk script has an initial spreadsheet like
I posted a question to the DBunit mailing list about an error I see
All of my projects include very similar tasks and quite recently I've been thinking
I have a similar question posted, but did not quite get the answer I
I still don't quite understand what a closure is so I posted these two
I'm a php developer, but recently had to write the same application twice, once

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.