B
brendan
Hello, I have been scripting for moz and then checking everything is working
in IE ... except I forgot to check at one point and have only just realised
that there is an error in blasted IE.
The below function [with a few snips] breaks up a search string using
[column][colon][text]
i.e. "title:Star Wars author:George Lucas date:1971";
should split to:
title=>star wars,
author=>george lucas
date=>1971
This works perfectly in mozilla but bugs out in explorer (results in 'george
lucas'=>'1971' ... given IE's crappy debugging I can't pinpoint the exact
problem
any ideas?
var search_text= "title:Star Wars author:George Lucas date:1971"; // random
bit of text here
thestring=search_text.replace(/^\s*|\s*$/g,""); //trim string
var regexp=/\s*(\w+):/ig;
var writestring=thestring.split(regexp);
for(var i=1;i<writestring.length;i+=2) {
j=i+1;
thevar=writestring;
theval=writestring[j];
alert(thevar+'=>'+theval); // do something with the vals (usually put
into array)
}
in IE ... except I forgot to check at one point and have only just realised
that there is an error in blasted IE.
The below function [with a few snips] breaks up a search string using
[column][colon][text]
i.e. "title:Star Wars author:George Lucas date:1971";
should split to:
title=>star wars,
author=>george lucas
date=>1971
This works perfectly in mozilla but bugs out in explorer (results in 'george
lucas'=>'1971' ... given IE's crappy debugging I can't pinpoint the exact
problem
any ideas?
var search_text= "title:Star Wars author:George Lucas date:1971"; // random
bit of text here
thestring=search_text.replace(/^\s*|\s*$/g,""); //trim string
var regexp=/\s*(\w+):/ig;
var writestring=thestring.split(regexp);
for(var i=1;i<writestring.length;i+=2) {
j=i+1;
thevar=writestring;
theval=writestring[j];
alert(thevar+'=>'+theval); // do something with the vals (usually put
into array)
}