473,382 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Why won't the android browser load/display xml?

57
I'm trying to find out why the android browser won't load and/or display my XML data. It works fine on computer browsers (FF, IE, Safari, Chrome, Opera) and even in iPhone's Safari, but when I view the same page in my android's browser, nothing is displayed...it's just blank.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function loadXMLDoc(dname) {
  5.     var xmlDoc;
  6.     if (window.XMLHttpRequest) {
  7.         xmlDoc = new window.XMLHttpRequest();
  8.         xmlDoc.open("GET",dname,false);
  9.         xmlDoc.send("");
  10.         return xmlDoc.responseXML;
  11.     }
  12.     // IE 5 and IE 6
  13.     else if (ActiveXObject("Microsoft.XMLDOM")) {
  14.         xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  15.         xmlDoc.async=false;
  16.         xmlDoc.load(dname);
  17.         return xmlDoc;
  18.     }
  19.     alert("Error loading document");
  20.     return null;
  21. }
  22. </script>
  23. </head>
  24.  
  25. <body>
  26. <script type="text/javascript">
  27.     xmlDoc = loadXMLDoc("news.xml");
  28.     x = xmlDoc.getElementsByTagName('article');
  29.     for (i=0; i<x.length; i++) {
  30.         document.write("<span class='h2'>" + x[i].getElementsByTagName("title")[0].childNodes[0].nodeValue + "</span><br />");
  31.         document.write("<span class='gray'>" + x[i].getElementsByTagName("date")[0].childNodes[0].nodeValue + "</span><br /><br />");
  32.         document.write(x[i].getElementsByTagName("text")[0].childNodes[0].nodeValue + "<hr />");
  33.     }
  34. </script>
  35. </body>
  36. </html>
Any ideas?
Thanks in advance!!!
Dec 2 '10 #1
0 1906

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: NotGiven | last post by:
Say you have three pages, a search page, a results/master, and a detail page. You choose parameters on your search page and submit the page. The results show in the reults/master page. You...
8
by: Michael G. Schneider | last post by:
With Windows 2003 Server... Imagine the following scenario: there is a simple ASP page, for example just a single Response.Write statement. There is a virtual directory pointing to the...
3
by: Rob | last post by:
Each time a webform is posted back (submitted), another URL is added to the browser's history list. My web application allows a back button to return to previously visited pages, but I do not wish...
4
by: Lauchlan M | last post by:
All of a sudden, with ASP.NET 1.1 one happily installed and working, VS.NET tells me "Visual studio.net has detected that the specified web server is not running asp.net version 1.1. You will be...
15
by: H00ner | last post by:
Hello All Hope you can help Been pulling my hair out about a popup problem in ASP.NET. One of the forms i wrote requires the user to select a product from a list in a popup web form. the...
6
by: James Black | last post by:
'When my form is submitted, I have onsubmit pointed to the following code snippet. But, the button is not actually set to disabled and the style.visibility changes are not made for several...
15
by: tshad | last post by:
I was looking for a way to handle refreshes (user pressed refresh button) and found a piece of code to check if a Web page was refreshed but I can't get it to work. The code is:...
13
by: David W. Fenton | last post by:
I've been struggling the last two days with something I thought was very easy, which is to open a web page with a form on it and populate the form with data passed in a query string (either POST or...
10
by: Conrad Lender | last post by:
In a recent thread in this group, I said that in some cases object detection and feature tests weren't sufficient in the development of cross-browser applications, and that there were situations...
3
HaLo2FrEeEk
by: HaLo2FrEeEk | last post by:
Ok, I've done a little research on this subject and I've come up with 2 good methods. The first uses a PHP script that detects the $_SERVER variable and parses it for information that might indicate...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.