Emualtor JS/PHP. GET_URL for javascript similar to $_GET on php
#Content
HTML CSS JS
#how to use
The variable 'par' is the parameter master of this code, that's what you want to take these URL's, then this code will catch all you're after the amount you determine the variable 'par', in this case what you see in the code it takes which is the value after '"= example2" and before any &. I used the & because in a php system is more what is separating GETs another, the more you can override this value by the tab you are using.
The code works in any situation, in the example html have trés examples link one early one in the middle and one at the end, the code actually simulates all the php $ _GET do, it's as if you were using $ _GET [example2 ' '], in the case of this example that is in the script.
Everything after the 21 line or after the alert is for testing only is not part of the process in sí, you can change to any css setting you want to change. The alert is for you to test whether a variable is coming where you want, while developing me was very helpful so I let so you can help it, that's why it was reviewed, it is not necessary for the operation of script.
Any questions please contact me, I hope this code will help you a lot.
#Como usar
A variavel 'par' é o parametro mestre desse código, é o que você quer tirar dessas url's, então esse código vai pegar tudo que estiver depois do valor que você determinar na variavel 'par', nesse caso que está vendo no código ele pega o valor que está depois de '"exemplo2=" e antes de qualquer &. Eu utilizei o & porque em um sistema php é oque mais se encontra separando GETs de outro, mais você pode substituir esse valor pelo separador que estiver utilizando.
O código funciona em qualquer situação, no exemplo html temos trés exemplos de link um no início outro no meio e outro no final, o código realmente simula tudo que o $_GET do php faz, é como se você estivesse utilizando $_GET[exemplo2''], no caso desse exemplo que está no script.
Tudo após a linha 21 ou após o alert é somente para teste não faz parte do processo em sí, você pode alterar para qualquer configuração css que queira alterar. O alert serve para você testar se a variavel está chegando onde você quer, durante o desenvolvimento me foi muito útil por isso eu deixei para que possa auxilia-lo, esse é o motivo dele ter sido comentado, ele não é necessário para o funcionamento do script.
Qualquer dúvida entre em contato comigo, tomara que esse código lhe ajude bastante.
#Licence @Renan Pantoja Vilas 2015 Licensed under Apache License Version 2.0, January 2004