Wednesday, May 14, 2025

Breaking News
>> Securing and encrypt View State and Cookies values  >> Page has one or more controls that do not correspond with   >> “The Controls collection cannot be modified because the control contains code blocks”  >> How to fix "Validation(): Element 'xxxx' is not supported  >> How to create a new session in ASP.NET programmatically  >> MySQL Database Backup using mysqldump command    

Editors Picks

Monday, January 9, 2012

How to access Query string in javascript?


<script type="text/javascript">
    function getParameterByName()
    {
      var name="QueryStringVariableName";
      var value='';
      name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
      var regexS = "[\\?&]" + name + "=([^&#]*)";
      var regex = new RegExp(regexS);
      var results = regex.exec(window.location.href);
      if(results == null)
        value= "";
      else
        value= decodeURIComponent(results[1].replace(/\+/g, " "));
    }

    script>

No comments :

Post a Comment

Contact Us

Name

Email *

Message *