tsuji
I don't like the look of the regex using greedy match
In the complete code the RegExp is non-greedy as it spans multiple lines.
Code:
title=" language:(.|\s)*?<\/la
Alerting the length or escaping the string is a good ideal.
It didn't occur to me to do this as normally I would have used Perl for this and used it's chomp function right off the bat. By doing so I never have this type of issues arise.
Why are all the spaces between the object and the dot method?
Typo I should have copy/paste.
Code:
var titleLang=new Array; another typo
should have been "var titleLang=new Array();" or better yet "var titleLang=[];"
And then, what is the double </span>?!
As i stated before I didn't write the code that is being parsed. There are actually 5 spans for each block of code everything is written in to a span, then another span is used as a container. Hence the earlier statement about monkeys in the lab. It looks like the code was probably dynamically created.
ps: What kind of conventions you adapt in scripting.
Pretty much anything, I will normally use whatever is the best fit is for the job at hand. But for this I'm stuck using JavaScript. I'm building an HTA, and everything is being done client side.
My main two criteria are:
1. The code has to work on any machine here, that means developer station and non-developer station.
2.Ease of use.(manager has to be able to use it.)
Non-developer workstations do not have Perl installed and may or may not have any other run-times available.
The only thing i know for certain that is level across all workstations is IE.
I'm using an HTA to get around all the browser security issues as well as provide the standard look and feel of a GUI.
The team is mostly comprised of Java programmers thus they are more familiar with JavaScript than VbScript. So for maintainability it makes more since to use JavaScript. I guess it's not all bad, as I use activeX controls and WSH in my JavaScript.
Again, thanks for your help, it's much appreciated.