Solved

Close button not working

Posted on 2014-02-24
9
344 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 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can display objects ? 3 25
Why does my button disappear? 3 29
jQuery - how can I set focus to first valid element in dropdown? 2 16
Remove lines by logo 2 23
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/…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

863 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

21 Experts available now in Live!

Get 1:1 Help Now