www.webdeveloper.com
Results 1 to 2 of 2

Thread: window.close(); not working in IE9

Hybrid View

  1. #1
    Join Date
    Nov 2013
    Posts
    8

    window.close(); not working in IE9

    I don't understand how this can't be working. It has been tested OK in FireFox. This is my code:

    Code:
     <script>
     function closeWin()
    {
    var location = document.getElementById("searchbox").value;   //TextField
        
        localStorage.setItem("routeName", location);	
    	
    window.close();
    }
    
    <button onclick="closeWin()">Välj</button>
    
     </script>
    Why isn't it working?

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,670
    what if you try that code this way?

    Code:
    <script>
    function closeWin(){
    var loc = document.getElementById("searchbox").value;   //TextField
    localStorage.setItem("routeName", loc);
    window.close();
    }
    </script>
    <button onclick="closeWin()">Välj</button>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles