Shineyrock web design & consultancy

Shineyrock

Searched for: "using" / 1124 results

How to Enable or Disable a Button With [removed] jQuery vs Vanilla

…using jQuery 1.5+, you'll need to use the prop method instead of the attr method as shown in the following snippet. //... $('#submitButton').prop('disabled', true); Alternatively, if you want to remove any attribute of an element, you can also use the removeAttr method of the jQuery object as shown in the…


How to Enable or Disable a Button With [removed] jQuery vs. Vanilla

…using jQuery 1.5+, you'll need to use the prop method instead of the attr method, as shown in the following snippet. //... $('#submitButton').prop('disabled', true); Alternatively, if you want to remove any attribute of an element, you can also use the removeAttr method of the jQuery object, as shown in the…


5 Real-Life Uses for the JavaScript reduce() Method

…using of all JavaScript iterators. Let's take a look at some use cases for the JavaScript reduce() method. 1. Summing an Array Using reduce() The easiest and perhaps most popular use of the JavaScript reduce method is to get the sum total of a list of numbers. For example, here's…


Create a JavaScript AJAX Post Request: With and Without jQuery

…Using AJAX leads to faster page renders because it can be used to update only the parts of the page that need to change, as opposed to reloading the entire page. That also reduces the frequency of requests to the web server, which in turn leads to faster response times.…


Adding and Removing Elements From Arrays in JavaScript

…using array methods. For example, we can reverse an array using the reverse() method as follows: const people = ['patrick', 'chimamanda', 'joe', 'sam'] let reversedPeople = people.reverse() console.log(reversedPeople) // ["sam", "joe", "chimamanda", "Patrick"] We can also use the includes() method to check if a value exists in an array: const…


Read a CSV to Array in PHP

…using the array_map() and str_getcsv() function. Introduction Storing data files in comma-separated values (CSV) format is no new thing. In fact, it’s one of the most common ways of storing data due to its simplicity—CSV files are easy to read and write, and can be opened in a basic text…


Read a CSV to an Array in PHP

…using the array_map() and str_getcsv() functions. Introduction Storing data files in comma-separated values (CSV) format is no new thing. In fact, it’s one of the most common ways of storing data due to its simplicity—CSV files are easy to read and write, and can be opened in a basic text…


The Best Way to Deep Copy an Object in JavaScript

…using the following methods: Method Pros Cons shallow copy with = clear and direct, the default only shallow copies objects JSON.stringify() and JSON.parse() deep copies nested objects doesn't copy functions Object.assign() copies the immediate members of an object—including functions doesn't deep copy nested objects the ... spread operator simple syntax,…


WordPress Website Maintenance Guide For Beginners

…using different devices (mobile phones, tablets, desktops, etc) and ensure that the site looks good on all of them. You can simulate these devices directly in your browser by using the built-in developer tools (click F12 to toggle it on Google Chrome) Inspect the images. Check that all the site's…


How to Create a Privacy Policy Page in WordPress

…using version 5.9 or a later version of WordPress, you should have the privacy policy page included by default. This might be true for other 5.x versions. To check for it, log in to your WordPress admin dashboard and navigate to Pages > All Pages. If the privacy page is…


Refine Search

Save This Search?

Saved Searches

You have not saved any searches yet.