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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:15:43+00:00 2026-05-22T14:15:43+00:00

My index.html has a button( id="my-btn" ): <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>My

  • 0

My index.html has a button(id="my-btn"):

<html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>My INDEX PAGE</title>
    </head>
    <body>
        <br><input type="button" id="my-btn" value="OPEN NEW WINDOW"/>
        <script src="js/my.js"></script>
        <script src="js/jquery-1.5.1.js"></script>
    </body>
    </html>

js/my.js handles button click event, when my-btn button is clicked, a new browser window will be opened with a new page(test.html)

my.js:

$('#my-btn').click(function(){  
  window.open('test.html', 'testwindow');
});

The new page(test.html) opened in new browser window:

test.html:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TEST</title>
</head>
<body>
    <div id="my-name"></div>
    <script src="js/test.js"></script>
    <script src="js/jquery-1.5.1.js"></script>
</body>
</html>

In the new page, test.js will be invoked and it will append the text "JOHN" as the content of this page

js/test.js

$(document).ready(function(){
    $("#my-name").append("<strong>JOHN</strong>");
});

But, when the test.html page opened in a new popped up browser window, I did not see the text "JOHN", it is an empty page, why?

(I have jquery-1.5.1.js under "js/" directory, and all JavaScript files are under js/)

  • 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-22T14:15:44+00:00Added an answer on May 22, 2026 at 2:15 pm

    Pretty simple here…

    You’re calling $(document).ready… before $ is defined.

    This happens in the jquery, so you need to switch up your script order:

    <script src="js/jquery-1.5.1.js"></script>
    <script src="js/test.js"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've downloaded the following template: http://www.styleshout.com/templates/preview/Refresh11/index.html But unfortunately, it has rounded corners and shades.
Inside my index.html.erb <script type= text/javascript> var msg = Hello World ; </script> i
http://something.com:80/somedir/index.html?type=test;one=onevalue#nose This is typical URI structure my question is what is #nose and how
I'm using the overlay jquery from here: http://flowplayer.org/tools/overlay/index.html Within my overlay I have a
My index.html page for my project needs some Ruby code so I need to
I have an index.html and global.css files. When I open these files at Coda,
in my code for index.html I use jQuery and have a link with id
I have a view and template called index.html. I have a image which is
I have a website consisting of an index.html, a number of style sheet files
Absolute beginner question: I have a template file index.html that looks like this: ...

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.