Solved

Close button not working

Posted on 2014-02-24
9
342 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 33

Expert Comment

by:paulmacd
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 32

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to dynamically set the form action using jQuery.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now