Solved

Close button not working

Posted on 2014-02-24
9
347 Views
Last Modified: 2014-03-05
I have the following code to close a browser window when clicked on, I am using chrome but it is not doing anything.

<input name="Btnclose" type="button" class="bodytext" id="Btncancel" onClick="parent.window.close()" value="    Close    ">

Anything missing ?
0
Comment
Question by:amucinobluedot
9 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 39882967
I'm not conversant with Chrome's security settings, but I wouldn't be surprised if there were a setting to either disable javascript, or to prevent this type of javascript from running.

Does the code work in other browsers?

Does the code work with Chrome on other machines?
0
 

Author Comment

by:amucinobluedot
ID: 39882977
I will check.
0
 
LVL 33

Expert Comment

by:Big Monty
ID: 39883016
is this browser window a child window or just the main window? if it's just the main window(), try just doing window.close()
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39883295
JavaScript is not allowed to close a window it did not open.
0
 

Author Comment

by:amucinobluedot
ID: 39883321
If it wasn't opened that way how can I just close a window not opened by javascript ?
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 500 total points
ID: 39883330
Click the X
Or in the window itself run self.close()
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39884653
Can you describe what this is for and how it is opened in the first place?  Is this a pop up or a modal?
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question