[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]
by Saima Salim via Digital Information World
"Mr Branding" is a blog based on RSS for everything related to website branding and website design, it collects its posts from many sites in order to facilitate the updating to the latest technology.
To suggest any source, please contact me: Taha.baba@consultant.com
So you want to get a parameter from a URL? URL parameters (also called query string parameters or URL variables) can have lots of useful data including product info, user preferences, link referrals, and more.
Let's get started!
Let's say you have the following url:
http://example.com/?product=shirt&color=blue&newuser&size=m
Here's a function to give you all the URL parameters as a neat object:
function getAllUrlParams(url) {
// get query string from url (optional) or window
var queryString = url ? url.split('?')[1] : window.location.search.slice(1);
// we'll store the parameters here
var obj = {};
// if query string exists
if (queryString) {
// stuff after # is not part of query string, so get rid of it
queryString = queryString.split('#')[0];
// split our query string into its component parts
var arr = queryString.split('&');
for (var i=0; i<arr.length; i++) {
// separate the keys and the values
var a = arr[i].split('=');
// in case params look like: list[]=thing1&list[]=thing2
var paramNum = undefined;
var paramName = a[0].replace(/\[\d*\]/, function(v) {
paramNum = v.slice(1,-1);
return '';
});
// set parameter value (use 'true' if empty)
var paramValue = typeof(a[1])==='undefined' ? true : a[1];
// (optional) keep case consistent
paramName = paramName.toLowerCase();
paramValue = paramValue.toLowerCase();
// if parameter name already exists
if (obj[paramName]) {
// convert value to array (if still string)
if (typeof obj[paramName] === 'string') {
obj[paramName] = [obj[paramName]];
}
// if no array index number specified...
if (typeof paramNum === 'undefined') {
// put the value on the end of the array
obj[paramName].push(paramValue);
}
// if array index number specified...
else {
// put the value at that index number
obj[paramName][paramNum] = paramValue;
}
}
// if param name doesn't exist yet, set it
else {
obj[paramName] = paramValue;
}
}
}
return obj;
}
The post Quick Tip: Get URL Parameters with JavaScript appeared first on SitePoint.
Ben Strickland is Founder and CEO of Alliance Software, a custom software development firm. He also founded Noble Samurai, an online marketing company that at one stage was one of the top five tools in the world for SEO, as well as Web2Tv, an in-house television service for the aged care industry that was recently purchased by Swift Networks, a Perth-based publicly listed firm.
Despite his many successes, Ben has also experienced an extreme failure with Email Samurai. Overconfident from the creation and successful launch of Market Samurai, an online marketing solutions venture, his team thought they could create anything in that field. So, they developed Email Samurai, an email marketing solutions program, yet soon realized it wasn’t a problem that needed to be solved when seeking customers. From this experience, they grew knowledge and customer awareness.
Ben’s experience in executing and operating businesses led him to the realization there are two common results when starting up and they’re polar opposites; it’s either going to be a real struggle or a booming success without much in the middle. To avoid the struggle, Ben suggests there are clear methods to undertake, ensuring the scales are tipped in your favor. It all starts with your commitment of time.
How much time would you invest to dramatically help your start up?
Investing your time in research to thoroughly understand — or at the very least expose yourself — to the market place you’re entering is the most valuable and smartest thing you can do for your business. Offset complications and failures by knowing your customer and their needs to ensure your product solves an existing problem, and that takes time.
In Ben’s Master Series presentation with WeTeachMe he also breaks down four options for those looking to get into business ownership, as well as their full list of pros and cons: start a normal business, buy a franchise, buy an established business, and start a startup. During his talk, he then further delves into how to “be smart” for each option.
The post Jumpstart Your Business by Being Smart appeared first on SitePoint.
‘Minimal Résumé’ is a free Résumé HTML template designed by Nicolas Meuzard and built by New to design. It’s real simple and text-only but will do the job acting as a clean, legible online Curriculum Vitae.
ps. we currently have a $2.95/month hosting special with Bluehost, perfect to host your Résumé on your own domain (that’s free if you sign up for a year).
Super simple One Pager (built using Webflow) for Benjamin Issenmann but features a unique project preview screen floating in your browser corner as you scroll. Can only assume this sticky window was inspired by recent YouTube and Facebook app video trends.