![]() |
$_GET 100% in Javascript
Hey all i have spent about 2 hours today getting this working cross browser and working properly.
This is a 100% Implementation of php $_GET and works perfectly in JavaScript And when i say 100% i mean it, none of this key=val it works with array[]=>val E.G if you have the url hello.html?page=2&filters[]=minPrice&filters[]=maxPrice&minPrice=100&maxPrice=1000 and as you can see there is an array inside this GET information filters[] it will setup $_GET['filters'][0] = minPrice and $_GET['filters'][1] = maxPrice So you want to see the code here it is:: PHP Code:
|
What's the use? As long as you don't use a Data Base I might rise a legitimate question: why to submit data? To where? To whom?
If you need to send data to DB, you need a server-side solution. If you don't ... well, if you don't, why bother to submit data? Do I miss something? |
Quote:
So JavaScript can $_GET so it can loop though them add them to a new URL string and allows you to filter the $_GET to how you want it, once the site that uses it is live i will show you an example My Data is used in both php and JavaScript form the URL so i need both but i have an Array in the GET so i needed to build a parser for it |
| All times are GMT +1. The time now is 09:45 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.