Solved

Close button not working

Posted on 2014-02-24
9
349 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

 
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 53

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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

739 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