English 中文(简体)
JS is t 改为 XML
原标题:JS doesn t read XML

我有一份PHP文件,其中建立了XML文档和一份可读XML文件的联合文件。 当我用超文本处理一个子公司时,它把我转至能够创建XML档案的PHP档案中,但联合材料没有读过。

GDownloadUrl("phpsqlajax_genxm1l.php", function(data) {
  var xml = GXml.parse(data);
  var markerid = xml.documentElement.getElementsByTagName("marker");
  for (var i = 0; i < markerid.length; i++) {
    var type = markerid[i].getAttribute("type");
    //var point = new GLatLng(parseFloat(markerid[i].getAttribute("lat")),
                            //parseFloat(markerid[i].getAttribute("lng")));
    var date = markerid[i].getAttribute("date");

    var punktx = markerid[i].getAttribute("point");
    var punkt = punktx.toString();
    var temp = new Array();
    temp = punkt.split(",");
    var point = new GLatLng(temp[0],temp[1])


    var marker = createMarker(point, date, type);
    map.addOverlay(marker);
  }
});

如何解决这一问题? 这份联合材料应当从XML文档中获取数据,并在我的谷歌地图上打上标识,但联合材料文档却获得了开端或东西。

问题回答

When I tried viewing the XML feed you mentioned in the comments for the question, I got the following:

XML Parsing Error: no element found Location: http://www.liiklusinfo.ee/proov4/phpsqlajax_genxm1l.php Line Number 1, Column 1: ^

你们可以 par灭的XML饲料。 由于超文本浏览器应当尝试并贴上无效标记,但XML的正确行为是ort,如果标记无效,则失败。

解决与你的XML原料有关的问题,也许你会更乐于这样做。

http://www.w3schools.com/xml/xml_validator.asp” rel=“nofollow” http://www.w3schools.com/xml/xml_validator.asp 这应有助于查明与你的饲料有什么错误。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签