Programming: jQuery/Javascript

The new magic of True AJAX.

Posted At: 12/1/2021 12:51:29 PM
Posted By: Comfortably Anonymous
Viewed: 692 times
0 Dislikes: 0
Frontend environments evolve rapidly nowadays and modern browsers have already implemented a great deal of DOM/BOM APIs which are good enough for production use. We don't have to learn jQuery from scratch for DOM manipulation or event handling. In the meantime, thanks to the spread of frontend libraries such as React, Angular and Vue, manipulating the DOM directly becomes anti-pattern, so that jQuery usage has never been less important. This project summarizes most of the alternatives in native Javascript implementation to jQuery methods, with IE 10+ support.ℹ️ Notice:jQuery is still a great library and has many valid use cases. Don’t migrate away if you don’t want to!The alternatives are not completely equivalent in all scenarios, and it is recommended that you test it before using it.Read entire article at https://github.com/nefe/You-Dont-Need-jQuery
Posted At: 12/1/2021 12:36:17 PM
Posted By: Comfortably Anonymous
Viewed: 742 times
0 Dislikes: 0
The Fetch API provides a JavaScript interface for accessing and manipulating parts of the HTTP pipeline, such as requests and responses. It also provides a global fetch() method that provides an easy, logical way to fetch resources asynchronously across the network.This kind of functionality was previously achieved using XMLHttpRequest. Fetch provides a better alternative that can be easily used by other technologies such as Service Workers. Fetch also provides a single logical place to define other HTTP-related concepts such as CORS and extensions to HTTP.The fetch specification differs from jQuery.ajax() in the following significant ways:The Promise returned from fetch() won’t reject on HTTP error status even if the response is an HTTP 404 or 500. Instead, as soon as the server responds with headers, the Promise will resolve normally (with the ok property of the response set to false if the response isn’t in the range 200–299), and it will only reject on network failure or if anything prevented the request from completing.fetch() won’t send cross-origin cookies unless you set the credentials init option. (Since April 2018. The spec changed the default credentials policy to same-origin. Firefox changed since 61.0b13.)A basic fetch request is really simple to set up.Read More at https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
Posted At: 10/11/2017 3:45:38 PM
Posted By: Comfortably Anonymous
Viewed: 1934 times
0 Dislikes: 0
The Front-End/Javascript landscape has become a chaotic Tower of Babel situation. It's changing faster than anyone can keep up and people with merely a years difference in skillsets are having issues even communicating. It's not because people are lazy and not keeping up - you get on a year-long project and start with the latest/greatest and then tune out the world while you get that project completed, then look around at the end of the project and the world doesn't look the same anymore. 90% of the bleeding edge stuff is abandoned a year later. It's to the point of ridiculousness. We need probably slow down a bit and take a look at the things that don’t change all that much. Not only will this improve the quality of our work and the value we deliver — it will actually help us learn these new tools faster.What to learn in order to keep up with Front-End development these days:medium.freecodecamp.org/what-to-learn-in-2017-if-youre-a-frontend-developer-b6cfef46effd
Posted At: 12/21/2010 11:34:43 AM
Posted By: Comfortably Anonymous
Viewed: 2071 times
0 Dislikes: 0
Sending a null value in JSON is really easy, but it seems like every time you go to look up how to actually represent a null value in a JSON call to an AJAX web service you instead end up with a bunch of discussion on using JSON.parse / JSON.stringify and helper methods to do just that. [No slam on using the JSON object, it's extremely helpful, just some times you don't need it.]But sometimes you just need to know "How do I represent a NULL value?" or "Why does the web service keep choking on my null values?"It's more of a mental adjustment than anything super tricky.Typically when you run into this issue, you've been attempting to build your JSON string using variables. Something like:var x = 22; var y = null;var json = "{"; // Open bracket json += "'valX':'" + x + "',"; // Set value of X json += "'valY':'" + y + "'"; // Set value of Y json += "}"; // Close bracketWhich gives you a resulting JSON string of:{'valX':'22','valY':'null'}This will cause your web service to choke on the the value assigned to valY. Why? Because you are passing the null value as a string. (See the'null' there? Yep, it's got single quotes around it. That's the problem.)To pass a null value is easy, just don't put it in quotes!! Easy as that, same thing only no quotes around null values:{'valX':'22','valY':null}Your web service will now happily accept your new value. :)While there's probably better ways to handle nulls, ...
Posted At: 11/10/2010 2:19:42 PM
Posted By: Comfortably Anonymous
Viewed: 1854 times
0 Dislikes: 0
Easy answer: Say you have a dynamic jQuery UI tab control with an id='tabs'.To determine the count of how many tabs are in the control, just use the following to obtain the count:var tabCount = $('#tabs').tabs('length');Easy as that... :)
Posted At: 8/21/2010 9:03:00 PM
Posted By: Comfortably Anonymous
Viewed: 1904 times
0 Dislikes: 0
Welcome