Jquery 3.6.1

0 views
Skip to first unread message

Leanne Wittlin

unread,
Aug 4, 2024, 11:07:16 PM8/4/24
to mechitute
NoteWhen you download jQuery, the file name may contain a version number, e.g., jquery-x.y.z.js. Make sure to either rename this file to jquery.js or update the src attribute of the element to match the file name.

Unfortunately, the code doesn't run until all images are finished downloading, including banner ads. To run code as soon as the document is ready to be manipulated, jQuery has a statement known as the ready event:


Note: The jQuery library exposes its methods and properties via two properties of the window object called jQuery and $. $ is simply an alias for jQuery and it's often employed because it's shorter and faster to write.


Copy the above jQuery code into your HTML file where it says // Your code goes here. Then, save your HTML file and reload the test page in your browser. Clicking the link should now first display an alert pop-up, then continue with the default behavior of navigating to


The following example illustrates the click handling code discussed above, embedded directly in the HTML . Note that in practice, it is usually better to place your code in a separate JS file and load it on the page with a element's src attribute.


Unlike many other programming languages, JavaScript enables you to freely pass functions around to be executed at a later time. A callback is a function that is passed as an argument to another function and is executed after its parent function has completed. Callbacks are special because they patiently wait to execute until their parent finishes. Meanwhile, the browser can be executing other functions or doing all sorts of other work.


The reason this fails is that the code executes myCallBack( param1, param2 ) immediately and then passes myCallBack()'s return value as the second parameter to $.get(). We actually want to pass the function myCallBack(), not myCallBack( param1, param2 )'s return value (which might or might not be a function). So, how to pass in myCallBack() and include its arguments?


To defer executing myCallBack() with its parameters, you can use an anonymous function as a wrapper. Note the use of function() {. The anonymous function does exactly one thing: calls myCallBack(), with the values of param1 and param2.


We recommend that you load libraries from the CDN via HTTPS, even if your own website only uses HTTP. Nowadays, performance is fast, and caching works just the same. The CDN's files are served with CORS and Timing-Allow headers and allowed to be cached for 1 year.


Seeing an outdated version? Make sure you're not using the "automatic version" links, like /jqueryui/1/..., but instead use URLs referring to exact versions. Due to concerns over caching and lack of compatibility between even minor versions, we have deprecated and stopped updating the automatic version aliases some time ago, so they will forever refer to an old version (in order to not break existing sites that still use them).


Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.


I have finished the JavaScript introduction course on Codecademy and it was VERY rough at the end. Promises and AJAX stuff was way out of my comprehension. Afterwards I decided to give JQuery a shot for fun.


I think the perception then changed from requiring jquery to do basic and advanced tasks and being thankful it was available, to the perception that one is worsening their own product by not using more modern native features that can achieve the same thing


It is not that it is bad , its just with JS dom now being more powerful alot of the complexity JS used to have is already addressed and hence there are less reasons to use jquery. JS has improved by including methods like like querySelect() and .addclasslist(). Since js dom has already reduced alot of complexity with new methods the difference jquery provide for less code is minimal and hence becomes unessary as with any library it increases the page loading time


Honestly , you dont have to make a big deal whether to learn jquery or not , people look at frameworks the wrong way similarly to bootstrap.The purpose of any library and jquery is to reduce coplexity in code and you decide whether if its worth for your project. Alot of document examples are still written in Jquery , and even if you want to use pure vanilla JS you still need to look at examples and translate jquery to pure JS.


I have used jquery and bootstrap for my final year project for example because writing it in pure css and js takes alot of time to write so using a framework make sense.Regardless you should spend more time in the fundamentals on your own personal projects ( html,css and js) because there are alot of times you have to tweak code and you have to look at the underlying structure of libraries like changing certain css in bootstrap for example


Thank You so much for the great work done, I have been using jQuery for over five years now and it has inspired me in a lot of ways to build special frameworks that just sits on top of it, making jQuery act like c and my framework like c++.


jQuery has been the most powerfull tool ever in web technology, over the years it has the impact jQuery has made in web development is tremendous.

jquery has been the base for countless no of js plugins/framework and it will be for coming years too.

Thanks for all your effort buddy.


Bravo John on building such a useful library. It is truly powering the web. I believe jQuery has become almost bigger than JavaScript. People look for jQuery solutions to problems easily doable in raw JS. This is a true testament to its popularity.


Thanks a lot for the wonderful library jQuery. I love jQuery personally because I started to work on the web using jQuery. Since then I fell in love with DOM and JavaScript. Now for more than 5 years I am full time front end web developer fully using jQuery.


Wao! Happy birthday John and jQuery. Jquery like a lamp illuminated the web. It resuscitated JavaScript at the time it was going down and put it at a high pedestal. I personally had made great apps with jquery. I love jquery. Thanks, John for making a great change to the IT World.


The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages. You can customize the date format and language, restrict the selectable date ranges and add in buttons and other navigation options easily.


This function uses the ISO 8601 definition of a week: weeks start on a Monday and the first week of the year contains January 4. This means that up to three days from the previous year may be included in the of first week of the current year, and that up to three days from the current year may be included in the last week of the previous year.


Datepicker provides support for localizing its content to cater for different languages and date formats. Each localization is contained within its own file with the language code appended to the name, e.g., jquery.ui.datepicker-fr.js for French. The desired localization file should be included after the main datepicker code. Each localization file adds its options to the set of available localizations and automatically applies them as defaults for all instances. Localization files can be found at -ui/tree/master/ui/i18n.


The $.datepicker.regional attribute holds an array of localizations, indexed by language code, with "" referring to the default (English). Each entry is an object with the following attributes: closeText, prevText, nextText, currentText, monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, weekHeader, dateFormat, firstDay, isRTL, showMonthAfterYear, and yearSuffix.


The datepicker widget uses the jQuery UI CSS framework to style its look and feel. If datepicker specific styling is needed, the following CSS class names can be used for overrides or as keys for the classes option:


Note: For options that have objects as their value, you can get the value of a specific key by using dot notation. For example, "foo.bar" would get the value of the bar property on the foo option.


Note: For options that have objects as their value, you can set the value of just one property by using dot notation for optionName. For example, "foo.bar" would update only the bar property of the foo option.


I'm doing it the same way, with the calls to require juqyer and jquery ui, but for some reason in 3.4, even though the jquery ui script is included in the source, it's not working. I'm wonderinf if it's being overriden by something somewhere else.


I did go through some grief when I first used it with 3.4, but unfortunately I cannot remember the details. I remember putting in some additional js calls to make it work and then at some point realising they were not necessary. My apologies that is so incredibly vague and unhelpful.


If they are not, then life is a bit harder. I use $.getScript from within the AMD module itself to load the plugin. You probably also need some plumbing to make sure we only load the library once. Here is an example from the Fancybox generico template...


I think that something else is loading JQuery into the global space, after you have loaded JQuery and JQueryUI. I think its unlikely that it is Moodle , more likely a theme or plugin. But it could be I suppose.


What happens in this case, is that JQuery UI was attached as a set of plugins to the JQuery in the global space. And then something else loads JQuery, which overwrites the previous one, and so those JQuery UI plugins are gone.


We are trying to cleanup some of the unnecessary dependencies we inherited from legacy CQ5.6.1. We noticed there was a list of jquery-ui.min.js/css loading on the public pages. We understand all /libs, /foundation client libraries serve mostly authoring; therefore we want to start removing some of these from publish instance. Primarily the jquery-ui.

3a8082e126
Reply all
Reply to author
Forward
0 new messages