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

  • Home
  • SEARCH
  • 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 1027449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:14:32+00:00 2026-05-16T12:14:32+00:00

I have this code, window.onload = function(){ if($(‘div.colorPicker’).length){ $(div.colorPicker).click(function(){ if($(‘.field_sku’).length){ code = $(this).children(‘.tmpSKU’).html(); if(!code

  • 0

I have this code,

window.onload = function(){
    if($('div.colorPicker').length){
        $("div.colorPicker").click(function(){
            if($('.field_sku').length){
                code = $(this).children('.tmpSKU').html();
                if(!code || code==null){
                    code = "Item Code not set yet";
                }
                $('.field_sku').filter(".value").html(code);
            }
        });
    }
}

I apply this to a custom module i created using jquery. It works ok in safari, firefox, chrome, but not in IE8, and I think it might not work as well in the other versions of IE.
I get this error

'length' is null or not an object on 
imagemultiple.js                                    line 2
Code:0                                              char 2

Without this

if($('div.colorPicker').length){
}

it worked fine in the other browsers i added that for IE after the error but it keeps bringing that error up.

My suspition is on the with Mootools and Jquery, that they might have a conflict there. And for some reason in IE8 that code that was working as Jquery (in the other browsers) might try to work as Mootools. I dont know if that make sense???

Anyways it works fine once a page has a div with class colorpicker, went it doesnt it is when the problem appears.

  • 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-16T12:14:33+00:00Added an answer on May 16, 2026 at 12:14 pm

    Sounds very odd. But you might be correct with some conflict problem here. Try

    jQuery.noConflict();
    (function($) { 
        $(function() {
             if($('div.colorPicker').length){
                $("div.colorPicker").click(function(){
                   if($('.field_sku').length){
                      code = $(this).children('.tmpSKU').html();
                      if(!code || code==null){
                         code = "Item Code not set yet";
                      }
                   $('.field_sku').filter(".value").html(code);
                   }
                });
             }
        });
    })(jQuery);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 512k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try: render :template => "user/index_%s" % @user.class.to_s.downcase May 16, 2026 at 5:38 pm
  • Editorial Team
    Editorial Team added an answer You can attach the debugger to your browser by selecting… May 16, 2026 at 5:38 pm
  • Editorial Team
    Editorial Team added an answer Given the following picture (see: http://local.wasp.uwa.edu.au/~pbourke/geometry/2circle/): here's a Java demo… May 16, 2026 at 5:38 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have this code window.onload = function() { function foo() { alert(test); } setInterval(foo(),500)
I have a js code: window.onload = function() { document.getElementById(Button1).onclick = function() { var
I have this javascript function myFunction(source) { window.open(source, Title, 'width=400, height=400'); } and in
I'm extremely new to JS and have this code that I'm trying to tweak.
This is my problem, I have a div and inside 2 divs, one is
I have this piece of Javascript and it just won't work. I allready checked
i'm checking out some newbie Google Maps API tutorial code. They have an example
I have a webform with a a couple of boundfields in an edit window
I have 2 functions on a seperate page that I am including of the
I already started this in javascript so I don't want to use jquery but

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.