This really use function formats a phone number to look like this: (201) 248 1421
var fv1 = v.substring(0,3);
var fv2 = v.substring(3,6);
var fv3 = v.substring(6,10);
return("("+fv1+") "+fv2+"-"+fv3);
}
This really use function formats a phone number to look like this: (201) 248 1421
This snippet searches for a string value inside an array with Javascript. Usage example is inside the console.log.
This is how you fadeIn() html content using the html() method available in jQuery:
I found this useful its an online pdf editor! Very good for simple tasks such as editing text.
http://www.pdfescape.com/
This java code snipped will take all non-alphamerics out of a string, every character EXCEPT for letters (upper and lower case), numbers AND a decimal. I made this to clean filenames and a period ‘.’ is what files use to decipher their extensions. If you want to take out the period also, remove it after the ’9′:
This is a really cool example of how to make “setters” and “getters” in PHP. All of you Java programmers will be well versed in the ways of set and get. These can be very important to the entire structure of your application and are vital when designing a structure. Here we create a class called “team” which contains a private variable called “$position.”
After creating your object (new team()) you can set “position” like this:
This will set the position to striker in the object. Creating an object may seem to some to be only available in this current script (team.php for example), however it’s important to remember that if you save the object to a session, it will be available throughout your entire web app!
This truly demonstrates the power of OOP in web development. Without this ability, OOP would be redundant, and overly complicated in almost every case.
If you run this in a terminal on a *nix machine it will tell you what version you have installed, if it returns an error or nothing at all then it’s not installed!
First, you have to set permissions in your manifest.json file:
The “getSelected” method gets the current selected tab, you can then access the URL of the current tab by using the “tab” object and specifying “url”. Remember that you can console.log the object to see everything that it contains!
This example capitalizes the first letter of each word in a string in Javascript. Useful for auto-formatting text:
This examples gets the first two characters of a given string in Javascript: