I want to parse javascript variable from strings. Something like that,
var string = "<script>window.arr=[1, 2.0, false]</script>";
Is there any way I can get the contents of a single variable from here?
//something like
function getVarContent(variable, string){
var re = new RegExp('');
return eval(re.exec(string))
}
getVarContent('arr', string)