Ottenere i parametri di una query string con Javascript
Una funzione Javascript che permette di ottenere i parametri presenti nella query string di un indirizzo web.
[JAVASCRIPT]
function getParam(param) {
param = param.replace(/[[]/, ‘\[‘).replace(/[]]/, ‘\]’);
var regexS = ‘[\?&]’ + param + ‘=([^&#]*)’,
regex = new RegExp(regexS),
results = regex.exec(window.location.href);
if (results === null) {
return ”;
} else {
return results[1];
}
}
[/JAVASCRIPT]
Tags: Ajax, Javascript javascript sviluppo tips
Pubblicato mercoledì 6 Maggio 2009 in Ajax, Javascript. Ultimo aggiornamento: giovedì 14 Maggio 2009.
Letture: 7170.
Link correlati
10 Essential HTML5 Frameworks
Here are 10 essential HTML5 frameworks you should have in your designer arsenal right now if you are serious about adopting HTML5 development into your daily workflow.
13 Free and Premium JavaScript/jQuery Calendars
When the website users or customers need to put any date or include months or years in a particular form, these JavaScript calendars really come handy for them.
Basics Of WordPress Theme Design
In this post we’ll look at the different aspects of WordPress theme development, starting with the fundamentals and then moving swiftly onto the basics, template tags and the more advanced files.
CSS3 Animated Media Queries
In this article we are going to look at media queries, have a code snippet you can use to start your media queries and show how you can combine CSS transition with the media queries to show an animated change to your elements.
Display your Favorite Tweets using PHP and jQuery
Display your latest tweets on your website or blog with a jQuery plugin and a PHP class.
Get to Know the WordPress Hierarchy
I have put together this post that examines the WordPress template hierarchy and the use of conditional statements. Technically you only need two files for a WordPress theme to work, index.php and style.css.
How to display your latest Google+ update on your WordPress blog
How you can easily display your latest Google+ update on your WordPress blog.