www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18

Thread: [RESOLVED] IE8 documentElement is null for local files

  1. #16
    Join Date
    May 2010
    Posts
    51
    Well midlet would be nice for mid range devices, I guess the androids, iphones ad win mobiles can handle a html page.

    I will try to create a midlet for those phones only supporting setting text and wait steps (maybe play sound). But only after I get the basic functions working in html for the smarter phones and desk/laptops.

    I've put the quirksmode page in my favorites and study it when I have time thanks.

  2. #17
    Join Date
    May 2010
    Posts
    51
    Found a way that will load xml data from local files using xml data island.

    Only tested with ie8 and no worky in FF (not tested in opera) the thing is that after I set the document either from xml island or xmlhttprequest most methods work on it (some need some tweaking with if statements).

    I guess here it says that I should not use it but can't read it since it's blocked here in China. The reason is that it's only supported by IE? Use xmlhttprequest instead?? but that doesn't work with local files.
    www.w3schools.com/xml/xml_dont.asp

    Code:
    <html>
    <head>
    <title>test course</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
    <script>
    function processData(){
    	var thisWorks=document.getElementById("xData").getElementsByTagName("info");
    	alert(thisWorks.length);
    	thisWorks=thisWorks[0];
    	alert(thisWorks.xml);
    	thisWorks=thisWorks.text;
    	alert(thisWorks);
    }
    function loadLesson(source){
    var bla=document.getElementById("xData");
    	// document.getElementById("xData").onload=processData; could not find an event that is triggered when data is loaded
    	document.getElementById("xData").src=source;
    	processData(); // just hope the data is available.
    }
    </script>
    </head>
    <body onload='loadLesson("data.xml");' >
    <xml id="xData" >
    </xml>
    </body>
    </html>

  3. #18
    Join Date
    May 2010
    Posts
    51
    I read that both safari and chrome do not allow you to read xml data when the document is file:// protocol.

    The best way I could solve it is not to use xml data but JSON or just make one big object variable containing the course data.

    Note tried the midlet with netbeans, that ide is amaizing. So easy and nice to use. Shame that the simplest midlet won't run on any phone I tried it on so will forget about that for now.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles