Monday, 7 March 2016

Find Query string value by Name

 function querySt(Key) {

            var url = window.location.href;

            KeysValues = url.split(/[\?&]+/);

            for (i = 0; i < KeysValues.length; i++) {

                KeyValue = KeysValues[i].split("=");

                if (KeyValue[0] == Key) {

                    return KeyValue[1];

                }

            }

        }

        function GetQString(Key) {

            if (querySt(Key)) {

                var value = querySt(Key);

                return value;

            }

        }

        alert(GetQString("case"))

No comments:

Post a Comment