SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    window.location not working in IE 6

    The following JS script works fine in FF and IE7. It fails though in IE6, which happens to be my target audience.

    Whats failing is.. the window.location is not calling.

    Code:
    function confirmation(text,url_link) {
    	var answer = confirm(text)
    	if (answer){
    		window.location = url_link;
    	}
    
    }

  2. #2
    SitePoint Zealot the DtTvB's Avatar
    Join Date
    Jul 2006
    Location
    Thailand
    Posts
    162
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try `location.href`.

    Note: If you are using this with `onclick` or the `javascript:` URI, this is highly not recommended!

    You should use return.

    For example:

    HTML Code:
    <a href="http://www.google.com/" onclick="return confirm('Go Google?');">Go</a>


Bookmarks

Posting Permissions

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