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 3344190
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:02:27+00:00 2026-05-18T01:02:27+00:00

I’m trying to A/B test our product drop view. below is the javascript code

  • 0

I’m trying to A/B test our product drop view. below is the javascript code I’m using:

  var url = window.location.href,
      defaultType = 'Gallery',
      otherType = 'List';
  if(Cookie.read('SEARCHVIEW') == otherType && Cookie.read('viewTypeChanged') != otherType){
      if(url.contains('v='+otherType)){
        url = url.replace('v='+otherType, 'v='+defaultType);
      }else if(url.contains('?')){
        url = url + '&v='+defaultType;
      }else{
        url = url + '?v='+defaultType;
      }

      window.location = url;
    }

After the page redirects in IE I get the dreaded 'null' is null or not an object and Object does not support this property or method errors.

This is happening in both IE 7 & 8

How can I fix this?

  • 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-18T01:02:28+00:00Added an answer on May 18, 2026 at 1:02 am

    I was able to resolve the problem. and for future reference I’ll post some code and explain.
    The offending code looks like this:

    <script type="text/javascript">
    
     window.addEvent('domready', function(){
    
    
      $('v_toggle').addEvents({
       'mouseenter': function(e){
       $('vertical_slide_container').show();
    
      },
       'mouseleave': function(e){
       $('vertical_slide_container').hide();
    
      }
      });
     });
     </script>
    
    </head>
    
    <body>
    
    
    <div class="mboxDefault">/div>
    <script type="text/javascript">mboxCreate('header',etc...);</script>
    

    My company uses Omniture for our A/B testing and my code was being run in the mboxCreate() function. You’ll notice above that there is code adding a domready event which adds hover events to our navigtaion(which is incidentally below my mboxCreate() code). What was happening was my code was redirecting, which stopped the page from loading, which also signaled that the DOM was ready. So when I called the redirect, the DOM ready code was run and was trying to add hover events on DOM elements that did not exists.

    Thus the 'null' is null or not an object' and the object does not support this method or property errors.

    The solution to the problem was to remove all domready events before I redirected so my error free code looks like this:

      var url = window.location.href,
          defaultType = 'Gallery',
          otherType = 'List';
      if(Cookie.read('SEARCHVIEW') == otherType && Cookie.read('viewTypeChanged') != otherType){
          if(url.contains('v='+otherType)){
            url = url.replace('v='+otherType, 'v='+defaultType);
          }else if(url.contains('?')){
            url = url + '&v='+defaultType;
          }else{
            url = url + '?v='+defaultType;
          }
          window.removeEvents('domready');
          window.location = url;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
i want to parse a xhtml file and display in UITableView. what is the
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim

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.