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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:07:57+00:00 2026-05-17T00:07:57+00:00

$(window).load(function(){ alert(typeof $.fn.init_deps); }); $(document).ready(function(){ /* Departments switcher */ $.fn.init_deps = function(s){ var o

  • 0
$(window).load(function(){

alert(typeof $.fn.init_deps);

});

$(document).ready(function(){

    /* Departments switcher */
    $.fn.init_deps = function(s){

        var o = {
            deps:false,
            cats:false              
        }
        $.extend(o,s);

        if(!s.deps || !s.cats) {return;}
        return this.each(function(){

            var select = $('<select id="department" name="department"></select>')
                .appendTo(this)
                .departments(s)
                .change(function(){
                    var select = $('select#category');
                    select.categories({cats:s.cats,current_dep:$(this).val()});

                    var p_width = select.parent().outerWidth();
                    var ch_width = select.outerWidth();
                    select.parent().css('width',p_width+'px')
                        .find('select').css('width',(ch_width + 8)+'px')
                        .parent().find('span').css('width',(p_width - 20)+'px');    
                    $.uniform.update(select);
                });

            var p_width = select.parent().outerWidth();
            var ch_width = select.outerWidth();
            select.uniform({selectClass:'selector uni1'})
                .parent().css('width',p_width+'px')
                .find('select').css('width',(ch_width + 8)+'px')
                .parent().find('span').css('width',(p_width - 20)+'px');            

        });

    }
});

Alert returns undefined in IE7, but in all other browsers it returns function.

Help, can’t figure out where is problem.

  • 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-17T00:07:58+00:00Added an answer on May 17, 2026 at 12:07 am

    window onload probably fires before the function is bound in IE. You should define the $.fn before document ready.

    $(window).load(function(){
    
    alert(typeof $.fn.init_deps);
    
    });
    (function($){
    
        $.fn.init_deps = function(s){
    
            var o = {
                deps:false,
                cats:false              
            }
            $.extend(o,s);
    
            if(!s.deps || !s.cats) {return;}
            return this.each(function(){
    
                var select = $('<select id="department" name="department"></select>')
                    .appendTo(this)
                    .departments(s)
                    .change(function(){
                        var select = $('select#category');
                        select.categories({cats:s.cats,current_dep:$(this).val()});
    
                        var p_width = select.parent().outerWidth();
                        var ch_width = select.outerWidth();
                        select.parent().css('width',p_width+'px')
                            .find('select').css('width',(ch_width + 8)+'px')
                            .parent().find('span').css('width',(p_width - 20)+'px');    
                        $.uniform.update(select);
                    });
    
                var p_width = select.parent().outerWidth();
                var ch_width = select.outerWidth();
                select.uniform({selectClass:'selector uni1'})
                    .parent().css('width',p_width+'px')
                    .find('select').css('width',(ch_width + 8)+'px')
                    .parent().find('span').css('width',(p_width - 20)+'px');            
    
            });
    
        }
    })(jQuery);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a deferred function that binds a mouseenter event: $(window).load(function(e) { var $container
$(document).ready(function(){ $(a[href*='http://']:not([href*='+location.hostname+'])).attr(target,_blank); $(a[target!='_blank'][target!='_top']).click(function(){ $(#actualcontent).load($(this).attr(href)); window.location.hash=$(this).attr(href); return false; }); }); So I have this code
I have this form submit code: Event.observe(window, 'load', init, false); function init() { Event.observe('addressForm',
I have a page and use window.addEvent('load', function() { alert('test'); }), but the browser
I want to extend Array and Object like the following code: $(window).load(function() { Array.prototype.x
The following code is having some problem with the jQuery. <script type="text/javascript"> $(window).load(function() {
I know how to hide address bar in general addEventListener(load, function() { window.scrollTo(1, 0);
Input rz value In the head I have: Event.observe(window, 'load', function() { $$(input).each(function(field){ Event.observe(field,
i have some jquery script which runs after the window has loaded $(window).load( function()
I have the following html + jquery: <body> <head> <script type=text/javascript src=jquery.js></script> <script> $(window).load(function()

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.