Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Close button not working

Posted on 2014-02-24
9
Medium Priority
?
353 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:Aleks
7 Comments
 
LVL 35

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:Aleks
ID: 39882977
I will check.
0
 
LVL 34

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 58

Accepted Solution

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

Author Comment

by:Aleks
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 2000 total points
ID: 39883330
Click the X
Or in the window itself run self.close()
0
 
LVL 54

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Ready to get certified? Check out some courses that help you prepare for third-party exams.
How do you create a user-centered user experience on your website? And what are some things you should consider in the process?
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

564 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