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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:16:38+00:00 2026-06-06T03:16:38+00:00

load.js: jQuery(document).ready(function($) { $(‘.dialog ul li’).click(function(e) { switch($(this).attr(‘id’)) { case ‘addProject’: $(‘.addDialog’).load(‘/add/addprojectform’); break; case

  • 0

load.js:

jQuery(document).ready(function($) {
    $('.dialog ul li').click(function(e) {
        switch($(this).attr('id')) {
        case 'addProject':
            $('.addDialog').load('/add/addprojectform');
            break;
        case 'addTask':
            $('.addDialog').load('/add/addtaskform');
            $('#dueDate').datePicker();
            break;
        }
    });
});  

And this is in the header:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script type="text/javascript">
$.noConflict();
</script>
<script src="js/utils.js"></script>
<script src="js/load.js"></script>  

The error I get is:

Uncaught TypeError: Object [object Object] has no method 'datePicker' load.js:10
(anonymous function) load.js:10
f.event.dispatch jquery.min.js:3
f.event.add.h.handle.i jquery.min.js:3  

I tried a few ways to fix it but still the error is there. What is it that causes the error? Thank you

  • 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-06-06T03:16:41+00:00Added an answer on June 6, 2026 at 3:16 am

    Since load performs an asynchronous ajax call and the element #duedate is inside the resource you have to wait the end of the call before using a method applied to that element

    Since any ajax method on jQuery returns a Deferred Object you can continue the code execution inside done() callback

    $('.addDialog').load('/add/addtaskform').done(function() {
        $('#dueDate').datePicker();
    });
    

    or using a simple success callback

    $('.addDialog').load('/add/addtaskform', function() {
        $('#dueDate').datePicker();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On document ready I run this code: jQuery(document).ready(function(){ jQuery('#button').click(function() { jQuery('#contact_form').load(/Users/mge/Downloads/jquery-ajax-1/readme.txt); return false; });
<script type=text/javascript> $(document).ready(function() { $(a).click(function() { $(#results).load( jquery-routing.php, { pageNo: $(this).text(), sortBy: $(#sortBy).val()} );
The following java-script is working fine (Jquery) $(document).ready(function(){ $('#c_area').load($('.m_top:first').attr('href')) }); $('.m_top').click( function(){ $(#myDiv).html('<img src=images/loading.gif
This is my Facebook connect Code: <script> jQuery(document).ready(function($){ $(.fb-login-button).live('click', function() { console.log('click'); fbEnsureInit(function() {
The following example code will load a jqGrid (this code works) ... jQuery(document).ready(function ()
I have a toggle button using this code: <script> jQuery(document).ready(function(){ jQuery('#MyToggleSwitch').live('click', function(event) { jQuery('.ElementToHideAndShow').toggle('show');
This is my jquery code jQuery(document).ready (function() { // post $('.post').bind('mouseenter mouseleave', function() {
I'm using this jquery to display some information on hover: jQuery(document).ready(function() { jQuery('.promo_slider_wrapper').hover(function() {
jQuery(document).ready(function(){ $(#red-products).hide(); $(#content-info).click(function(event){ $(#red-products).hide(); $(#red-information).show(); }); $(#content-product).click(function(event){ $(#red-information).hide(); $(#red-products).show(); }); $(#more).click(function(event){ load(this.href); return false;
I'm using the following code to load in content: <script type=text/javascript> jQuery.noConflict(); jQuery(document).ready(function(){ jQuery('.content-div').load(all-events.html);

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.