0

I've narrowed the problem down to this code...

var regex = /(?<=,')(.*)(?=')/;
var match = regex.exec(source);

... which is breaking my website on an iPhone (causing Javascript to stop working). My javascript is working fine in other browsers (Mac desktop, Android phone).

source is an onclick attribute that I'm pulling from an HTML element.

var allKeywords = document.getElementsByClassName("checkmark");
var source = allKeywords[i].onclick;

resulting in...

function onclick(event) {
keywordNegative('cat_gtr','cat_gtr');return false;
}

I'm trying to grab the second argument ("cat_gtr"). What's the better way to get it? By the way I have to use onclick inline because I'm entering the parameters using PHP.

chillywilly
  • 405
  • 3
  • 11

0 Answers0