Window.onload reported an error

datepicker can be executed at $(document). Ready but error is reported in window.onload ()

Uncaught TypeError: $(.). Datepicker is not a function

related codes

< script type= "text/javascript" >
$(document) .ready (function () {
alert ("document");
$("- sharpdate"). Datepicker ({

)
    yearRange: "-70:+0" 

});

});

window.onload= function () {
alert ("window")
$("- sharpdate"). Datepicker ({

)
    yearRange: "-70:+0" 

});

}
< / script >

what result do you expect? What is the error message actually seen?

Apr.07,2021

In the

window.onload version of your own demo, you must have put the jquery library at the end of the entire html. The code that assigns the onload is written before the jquery is loaded.

it won't be a problem to put the code that introduces jQuery before window.onload.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38023-2c0be.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38023-2c0be.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?