Ver Mensaje Individual
  #2 (permalink)  
Antiguo 22/03/2013, 09:22
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Saber si viene variable get con Jquery

Ese código lo único que va a verificar es si existe un elemento de id vrblg con valor 1, para nada va a chequear la Query string ó un post que puedas estar haciendo, deberías hacer algo como

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript">
  7. //<![CDATA[
  8. function recibirQS(parametros){
  9. var urlPag = window.location.search.substring(1);
  10. var urlVars = urlPag.split('&');
  11. for (var i = 0; i < urlVars.length; i++){
  12. var nombreParam = urlVars[i].split('=');
  13. if(nombreParam[0] == parametros){
  14. return nombreParam[1];
  15. }
  16. }}
  17. var nombre = recibirQS('nombre');
  18. if(nombre != undefined){
  19. alert("existe variable  nombre")
  20. }else{
  21. alert("NO existe variable  nombre")
  22. }
  23. //]]>
  24. </head>
  25. <a href="?nombre=carlos">Test</a>
  26. </body>
  27. </html>

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.