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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:20:43+00:00 2026-06-15T04:20:43+00:00

when i open a new window using window.open in firefox and try to navigate

  • 0

when i open a new window using window.open in firefox and try to navigate different section of the page within the new window using skip navigation does not work and preview window get reloaded.here is what i am doing.

<html>
<head>
    <script>
    function openWindow()
        {
            var win = window.open("","_blank");
            win.document.write("<!DOCTYPE html><html><head></head><body><a href='#rajeev'>hi</a><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><div id='rajeev'>To Come Here</div></html>");
            win.document.close();
        }
    </script>
</head>
<body>
    <button type="button" onclick="openWindow()">Display Date</button>
</body>
</html>
  • 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-15T04:20:44+00:00Added an answer on June 15, 2026 at 4:20 am

    You should be able to add the following onclick code to you link, instead of the hash:

    onclick='$(document).scrollTop($(\"#rajeev\").offset().top);'
    // Escaped the quotes since it will be placed in a document.write("");
    

    You’ll need to import jQuery in the popup’s code, but if I just use this:

    `win.document.write("<script src='http://code.jquery.com/jquery-1.8.2.js' type='text/javascript'></script>`
    

    The browser seems to interpret the </script> tag as the end tag for the whole “popup-writing” script.
    This can be circumvented by cutting up the </script> tag in the strings, as seen below.

    This code works for me in Firefox and Chrome:

    <html>
        <head>
            <script>
                function openWindow()  {
                    var win = window.open("","_blank");
                    win.document.write("<!DOCTYPE html><html><head><script src='http://code.jquery.com/jquery-1.8.2.js' type='text/javascript'></scr");
                    // Split up the </script> tag.
                    win.document.write("ipt></head><body><a  onclick='$(document).scrollTop($(\"#rajeev\").offset().top);'>hi</a><br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>&nbsp;<br><div id='rajeev'>To Come Here</div></html>");
                    win.document.close();
                }
            </script>
        </head>
        <body>
            <button type="button" onclick="openWindow()">Display Date</button>
        </body>
    </html>​
    

    Now, you will only need to style the <a> to make it look like you can click it, or replace it with a <button>, for example.

    (Stackoverflow kinda messes up the syntax highlighting in the code above, but it’s valid js. Also, you generally don’t want to add inline event listeners in your HTML.)

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

Sidebar

Related Questions

Is it possible to open a new tab in Firefox (in background) using window.open(http://www.google.com)
In Firefox 3, when I open a new window (or tab), using window.open, the
I am trying open a new window using url.Action. And the new Window url
I am trying to open a few links in a new window using Jquery
I am trying to open one window from another using makeKeyAndOrderFront. The new window
My links correctly open a new window when using IE8; but when I use
I'm using this javascript code in firefox addon: window.open(link); It opens a link in
Alright, I'm using form.target to open content in a new window. However, when I
i am using window.showmodeldialog for opening a new firefox browser window, i want to
I'm using the following code to open the link in a new window, its

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.