Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7541143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T07:49:03+00:00 2026-05-30T07:49:03+00:00

I need the code to work on IE6+, just wanted to check I haven’t

  • 0

I need the code to work on IE6+, just wanted to check I haven’t missed out support for any browsers.

This code works and I have tested on IE7, Firefox 10, Google Chrome 17 but I don’t have the other browsers to test. What I want to know if anyone else has done this and know what the code is, have I missed support for any browser with my code:

    if (!e) e = window.event;       
    e.returnValue = false;      
    if (e.preventDefault) e.preventDefault();           
    return false;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T07:49:05+00:00Added an answer on May 30, 2026 at 7:49 am

    preventDefault() is a w3c DOM Level 2 standard, so it should be implemented by all modern browsers.

    IE6 is not a modern browser however, and it doesn’t implement DOM Level 2 or preventDefault(). The alternative IE6 uses setting event.returnValue to false, as you did. Note that this will not affect event bubbling (in IE6 that would be accomplished by setting event.cancelBubble to true). So your code as it is should work in IE6 as well as all modern browsers to prevent the default action without stopping propagation.

    But I’d restructure the code to not set any properties on the event if you don’t have to:

    if (e.preventDefault) {
        e.preventDefault();
    } else {
        e.returnValue = false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been trying to get this code to work for hours! All I need
So, i need to have a blinking title, this code should work, but for
I have this code and I need to make this work: if ($handle =
I know this is a long-shot, but since I need this code to work,
I found all the code I need to make SHBrowseForFolder work in my application.
I need to work with some old C++ code that was developed in Visual
I need to convert some code done by someone else, to work in my
There is a weird code here that I need to make work.. can you
Am I doing something wrong if I need code like this in a Controller?
We have a project that will need to work in IE6,7,8. I'm not that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.