[Htmlparser-user] Script Tag question
Brought to you by:
derrickoswald
|
From: Srinivas V. <vip...@ho...> - 2007-07-02 00:53:13
|
Hello, I am having trouble getting the complete script code for some sc=
ript tags. I get the correct source for all script tags except this one. If=
I alter the script slightly, it does give me the complete script code. Her=
e is what I am doing: try{ Parser parser =3D new Parser("http=
://www.autos.yahoo.com"); NodeList list =3D parser.parse (null); =
NodeFilter filter =3D new MyNodeFilter(); // I have a filter to just =
give me script nodes NodeList nl =3D list.extractAllNodesThatMatch(=
filter,true); int len =3D nl.size(); for (int i =3D 0; i < =
len; i++) { ScriptTag n =3D (ScriptTag)nl.elementAt(i);=
System.out.println("Counter at "+i+n.getScriptCode()); =
} }For some reason, I dont get the full scr=
iptcode for one particular node. I only get a certain portion of it. Below =
is the original script code and for some reason it breaks at the penultimat=
e line(shown below). Any Ideas??//function getMakes(myArray, selected_make)=
function getMakes(myArray, selected_make_id) { var arrayLength =3D myArray=
.length; //var regex =3D new RegExp("[\' .-]","g"); //alert("selected_mak=
e_id:" + selected_make_id); for (var i=3D0;i<arrayLength;i++) { var mkS=
plitArray =3D myArray[i][0].split(":"); var makeName =3D mkSplitArray[0=
]; var makeValue =3D mkSplitArray[1]; var selected =3D ""; // if (m=
akeName.replace(regex,"").toLowerCase() =3D=3D selected_make.replace(regex,=
"").toLowerCase()) { if (selected_make_id =3D=3D makeValue) { sel=
ected =3D " selected"; } document.write('<option' + selected + ' valu=
e=3D"' + makeValue + '">' + makeName + "</option>\n"); } // for i ----=
--> If i remove this it works fine.}Cheers,=0A=
Srinivas.
_________________________________________________________________
Make every IM count. Download Windows Live Messenger and join the i=92m Ini=
tiative now. It=92s free.=A0=A0
http://im.live.com/messenger/im/home/?source=3DTAGWL_June07=
|