Sunday, February 21, 2010

getting the parameters from the current url using java script in MS CRM 4.0

getting the parameters  from the current url using java script:


var id= GetParam(‘id’);


 function GetParam(name) {            
          name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); 
         var regexS = "[\\?&]" + name + "=([^&#]*)";
         var regex = new RegExp(regexS); 
        var results = regex.exec(window.location.href); 
       if (results == null) return ""; 
      else return results[1]; 
  }

No comments:

Post a Comment