So I have a code that works fine on other browsers but it doesn't work on iPhones and Safari browser. When I debug it says "Invalid regular expression: nothing to repeat" for the following code.
  function getURLParameter(a) {
    a = (new RegExp("[?|&]" + a + "=([^&;]+?)(&|#|;|$)")).exec(location.search);
    if (null == a) return null;
    a = a[1];
    a = a.replace(/+/g, "%20");
    return decodeURIComponent(a)
}
Any help you can provide would be greatly appreciated.
 
    