Hi all, Can anyone point me what problem above code. i browse this code in IE i can view the result. But i browse with google chrome, it doesn't gv the result. it seem like no response or the javascript can't work. Thanks.
hi, i just check it with developer tool in google chrome and found that this error show out. Object # has no method 'load' createXML May i know how to load the xml file in google chrome? thanks.
dicman
Member
46 Points
45 Posts
javascript / createXML cannot work in googlew chrome "Object #<Document> has no method 'load'"
Feb 21, 2012 06:21 AM|LINK
<tr> <td class="formtitle">MATERIAL</td> <td>:</td> <td><select class="text" id="Material1" style="WIDTH: 310px" onchange="listC1.populate();"> <SCRIPT language="JavaScript">listB1.printOptions()</SCRIPT> </select></td> <td> </td> </tr>Hi all, Can anyone point me what problem above code. i browse this code in IE i can view the result. But i browse with google chrome, it doesn't gv the result. it seem like no response or the javascript can't work. Thanks.
asteranup
All-Star
30184 Points
4906 Posts
Re: javascript / createXML cannot work in googlew chrome "Object #<Document> has no method 'load'...
Feb 21, 2012 06:32 AM|LINK
Hi,
Why you have nested script tag inside select?
What exectly the following is-
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
dicman
Member
46 Points
45 Posts
Re: javascript / createXML cannot work in googlew chrome "Object #<Document> has no method 'load'...
Feb 21, 2012 07:21 AM|LINK
hi,
i not sure what is this, because this code is a part of code shown in my project.
if not mistaken is a list of dropdown list selection.
do you know how can make this code work in chrome?
thanks.
dicman
Member
46 Points
45 Posts
Re: javascript / createXML cannot work in googlew chrome "Object #<Document> has no method 'load'...
Feb 22, 2012 02:54 AM|LINK
hi, i just check it with developer tool in google chrome and found that this error show out. Object # has no method 'load' createXML May i know how to load the xml file in google chrome? thanks.
vinay13mar
Star
7756 Points
1626 Posts
Re: javascript / createXML cannot work in googlew chrome "Object #<Document> has no method 'load'...
Feb 22, 2012 02:59 AM|LINK
Hi,
Please share your javascript code also..
V.K.Singh
dicman
Member
46 Points
45 Posts
Re: javascript / createXML cannot work in googlew chrome "Object #<Document> has no method 'load'...
Feb 22, 2012 03:04 AM|LINK
<script language="javascript"> createXML("../XML/BizCard.xml"); <% DbUtil dbutil = new DbUtil(); DataSet ds; DataSet ds2; DataSet ds3; int iFirstCheck = 1; string sSetDefaultOption = ""; for (int i = 1; i<=5; i++) { Response.Write ("\n\n\nvar listB" + i.ToString() + " = new DynamicOptionList(\"Material" + i.ToString() + "\",\"Product" + i.ToString() + "\");\n"); ds = dbutil.get_dataset (@"SELECT prid, prcode, prlongdesc FROM tbrProduct WHERE (prid='1') ORDER BY prlongdesc"); foreach (DataRow dr in ds.Tables[0].Rows) { Response.Write ("listB" + i.ToString() + ".addOptions(\"" + dr["prcode"].ToString() + "\""); ds2 = dbutil.get_dataset (@"SELECT pacode, palongdesc, pwcode, pwdesc FROM tbrPaper Pa, tbrProduct Pr , tbrPaperWeight PW, tbrProduct_Paper PP WHERE Pr.prcode = '" + dr["prcode"].ToString() + "' AND PP.ppprid = Pr.prid AND PP.pppaid = Pa.Paid AND PP.pppwid = PW.pwid AND PP.status ='1' ORDER BY pwdesc, palongdesc"); foreach (DataRow dr2 in ds2.Tables[0].Rows) { Response.Write(",\"" + dr2["pwdesc"] + "gsm " + dr2["palongdesc"].ToString() + "\",\"" + dr2["pacode"].ToString() + dr2["pwcode"].ToString() + "\""); if (iFirstCheck == 1) { sSetDefaultOption += "listB" + i.ToString() + ".setDefaultOption(\"" + dr["prcode"].ToString() + "\",\"" + dr2["pacode"].ToString() + dr2["pwcode"].ToString() + "\")\n"; iFirstCheck = 0; } } Response.Write (");\n"); iFirstCheck = 1; } Response.Write(sSetDefaultOption); Response.Write ("\n\n\nvar listC" + i.ToString() + " = new DynamicOptionList(\"Volume" + i.ToString() + "\",\"Product" + i.ToString() + "\",\"Material" + i.ToString() + "\");\n"); ds = dbutil.get_dataset (@"SELECT prid, prcode, prlongdesc FROM tbrProduct WHERE (prid='1') ORDER BY prlongdesc"); foreach (DataRow dr in ds.Tables[0].Rows) { ds2 = dbutil.get_dataset (@"SELECT pacode, palongdesc, pwcode FROM tbrPaper Pa, tbrProduct Pr, tbrPaperWeight Pw ,tbrProduct_Paper PP WHERE Pr.prcode = '" + dr["prcode"].ToString() + "' AND PP.ppprid = Pr.prid AND PP.pppaid = Pa.Paid AND PP.pppwid = Pw.pwid ORDER BY pwdesc, palongdesc"); foreach (DataRow dr2 in ds2.Tables[0].Rows) { Response.Write ("listC" + i.ToString() + ".addOptions(\"" + dr["prcode"].ToString() + "|" + dr2["pacode"].ToString() + dr2["pwcode"].ToString() + "\""); ds3 = dbutil.get_dataset(@"SELECT DISTINCT pppvolume FROM tbrProduct_Paper_Price PPP, tbrProduct_Paper PP, tbrProduct Pr, tbrPaper Pa, tbrpaperweight PW WHERE PPP.ppid = PP.ppid AND PP.pppwid = PW.pwid AND PP.ppprid = Pr.prid AND PP.pppaid = Pa.paid AND PR.prcode = '" + dr["prcode"].ToString() + "' AND PA.pacode = '" + dr2["pacode"].ToString() + "' AND PW.pwcode ='" + dr2["pwcode"].ToString() + "'"); foreach (DataRow dr3 in ds3.Tables[0].Rows) { Response.Write(",\"" + dr3["pppvolume"].ToString() + "\",\"" + dr3["pppvolume"].ToString() + "\""); } Response.Write (");\n"); } } } Response.Write("var ppptype = \"" + Request.Cookies["cpricetype"].Value + "\";"); %>thanks for your reply. here is the part which cannot work in chrome.
dicman
Member
46 Points
45 Posts
Re: javascript / createXML cannot work in googlew chrome "Object #<Document> has no method 'load'...
Feb 22, 2012 06:18 AM|LINK
Anyone here know the solution?
i check in google found that this prolem also occur in safari too.
Thanks.
dicman
Member
46 Points
45 Posts
Re: javascript / createXML cannot work in googlew chrome "Object #<Document> has no method 'load'...
Feb 22, 2012 08:45 AM|LINK
Finally found the solution:
try { createXML("../XML/BizCard.xml"); } catch(e) //for chrome & safari { var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET","../XML/BizCard.xml",false); xmlhttp.send(null); xmlDoc=xmlhttp.responseXML; }