Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/06/2017, 23:05
Avatar de julia2021
julia2021
 
Fecha de Ingreso: diciembre-2014
Ubicación: Mexico
Mensajes: 152
Antigüedad: 9 años, 4 meses
Puntos: 11
Respuesta: Pasar parametro a JS vía URL

Hola xfxstudios, gracias por el dato, me gusta mucho, pero no quiero trabajar con arrays, te comparto como lo solucione y nuevamente gracias !!!!!

Código Javascript:
Ver original
  1. <SCRIPT LANGUAGE="JavaScript">
  2. // Con esta funcion capturamos el URL
  3. function getVarsUrl(){
  4.     var url= location.search.replace("?", "");
  5.     var arrUrl = url.split("&");
  6.     var urlObj={};
  7.     for(var i=0; i<arrUrl.length; i++){
  8.         var x= arrUrl[i].split("=");
  9.         urlObj[x[0]]=x[1]
  10.     }
  11.     return urlObj;
  12. }
  13. var misVariablesGet = getVarsUrl();
  14.  
  15.     if (misVariablesGet.mode == 'edit') {
  16.       document.getElementById("mi_campo_de_formulario").style.display = 'none';
  17.     }
  18. </script>