Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to put data from XML file to <select> ? Not working localy.

27 views
Skip to first unread message

foka

unread,
Apr 22, 2010, 11:56:14 AM4/22/10
to
Hi.I have got a problem with javascript and XML.
I want to put data from XML file to HTML <select> options.
My code is working but only if I put this (websites) on server, but I
want to run my html site on every comp, localy, for example from CD., on
windows without Apache etc.
When I run my site localy file:///C:/file.html then my <select> is empty.

My Ajax code:
function showGroups()
{
var url_file="../xml/groups.xml";
xmlDoc=loadXMLDoc(url_file); //wczytuje dane
var groupXml = xmlDoc.getElementsByTagName("group");
for (var i=0; i < groupXml.length; i++) {
document.forms['searchForm'].grupy.options[i] = new
Option(groupXml[i].firstChild.nodeValue,groupXml[i].firstChild.nodeValue);
}
}
window.onload=showGroups;

HTML part:

<select name="grupy" class="grupy">
</select>

My XML file
<?xml version="1.0" encoding="UTF-8"?>
<items>
<item>
<group>AK</group>
<name>COS AK</name>
</item>
<item>
<group>BZ</group>
<name>COS BZ</name>
</item>
<item>
<group>CA</group>
<name>COS CA</name>
</item>
</items>

Is there anyone who can help me?

Seal

Stefan Weiss

unread,
Apr 22, 2010, 12:11:37 PM4/22/10
to
On 22/04/10 17:56, foka wrote:
> Hi.I have got a problem with javascript and XML.
> I want to put data from XML file to HTML <select> options.
> My code is working but only if I put this (websites) on server, but I
> want to run my html site on every comp, localy, for example from CD., on
> windows without Apache etc.
> When I run my site localy file:///C:/file.html then my <select> is empty.
>
> My Ajax code:
> function showGroups()
> {
> var url_file="../xml/groups.xml";
> xmlDoc=loadXMLDoc(url_file); //wczytuje dane
[snip]

I assume that you've declared the xmlDoc variable somewhere else.

Which browser are you using, and what exactly does loadXMLDoc do (except
that it "reads data", if I translated the comment correctly)?

> var groupXml = xmlDoc.getElementsByTagName("group");

Did this line trigger an error? If not, did you enable error reporting
in your browser? If there really is no error, how come you get a valid
XML document that is somehow missing its <group> tags?

By the way, you may want use an asynchronous XMLHttpRequest.


--
stefan

VK

unread,
Apr 22, 2010, 12:37:43 PM4/22/10
to
On Apr 22, 7:56 pm, foka <crazys...@onet.eu> wrote:
> Hi.I have got a problem with javascript and XML.
> I want to put data from XML file to HTML <select> options.
> My code is working but only if I put this (websites) on server, but I
> want to run my html site on every comp, localy, for example from CD., on
> windows without Apache etc.
> When I run my site localy file:///C:/file.html then my <select> is empty.

Your loadXMLDoc (whatever it is) expects response status "200 OK" to
proceed, but when reading from the local file system the response
status is 0. Wherever it is, change
if (yourRequest.status == 200) { ...
to
if ((yourRequest.status == 200) || (yourRequest.status == 0)) { ...

P.S. Unless your currently security settings simply prohibit script
execution for local pages.

foka

unread,
Apr 22, 2010, 12:50:11 PM4/22/10
to
My javascript function:

function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}

What u suggest to correct? What and where to add?


VK pisze:


--
Pozdrawiam
Mariusz Bartyzel

---------------------
www.reservoirdogs.pl

foka

unread,
Apr 22, 2010, 12:59:15 PM4/22/10
to
> I assume that you've declared the xmlDoc variable somewhere else.
>
> Which browser are you using, and what exactly does loadXMLDoc do (except
> that it "reads data", if I translated the comment correctly)?
>
I used every browser. IE8, Chrome, Firefox.
Everything is ok if I run my site on serwer( I have wamp server on
Windows to test)


>
> Did this line trigger an error? If not, did you enable error reporting
> in your browser? If there really is no error, how come you get a valid
> XML document that is somehow missing its <group> tags?
>
> By the way, you may want use an asynchronous XMLHttpRequest.
>

I'm beginner. There is no errors. XML file is correct.

My whole test.html site:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"/>
<title>Techrol - Części zamienne do ciągników i maszyn</title>
<link rel="stylesheet" type="text/css" href="css/techrol.css"
media="screen"/>
<script type="text/javascript" src="../js/functions.js"></script>
<script type="text/javascript" language="javascript">

function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}


function showGroups()
{
var url_file="../xml/roups.xml";
xmlDoc=loadXMLDoc(url_file);

var groupXml = xmlDoc.getElementsByTagName("group");

for (var i=0; i < groupXml.length; i++) {

document.forms['searchForm'].groups.options[i] =

new
Option(groupXml[i].firstChild.nodeValue,groupXml[i].firstChild.nodeValue);
}
}

window.onload=showGroups;

</script>

</head>
<body>
<div id="header">
<img alt="" src="images/logo.jpg" /><h1>Header</h1>
</div>
<div id="content">
<div id="search">

<form id="searchForm"
action="files/techrol_search.html" method="get" onSubmit="return
checkSearch()">
<div id="searchField"><input name="search"
class="input" type="text" value=""/></div>
&nbsp;<span>Grupa:</span>
<select name="groups" class="groups">
</select>
<input class="submit" type="submit"
value="Szukaj" />
</div>
</form>
</div>

</div>
</body>
</html>
---------------------------------------


foka

Thomas 'PointedEars' Lahn

unread,
Apr 22, 2010, 1:14:42 PM4/22/10
to
foka wrote:

> [Stefan Weiss wrote:]


>> I assume that you've declared the xmlDoc variable somewhere else.
>>
>> Which browser are you using, and what exactly does loadXMLDoc do (except
>> that it "reads data", if I translated the comment correctly)?
>
> I used every browser. IE8, Chrome, Firefox.

OMG. That is "every browser" for you?

> Everything is ok if I run my site on serwer( I have wamp server on
> Windows to test)

No, not really.

>> Did this line trigger an error? If not, did you enable error reporting
>> in your browser? If there really is no error, how come you get a valid
>> XML document that is somehow missing its <group> tags?
>>
>> By the way, you may want use an asynchronous XMLHttpRequest.
>
> I'm beginner.

So not exactly in a position to say for sure that ...

> There is no errors. XML file is correct.

Doubtful, given ...

> My whole test.html site:
>
> <?xml version="1.0" encoding="UTF-8"?>

This triggers Compatibility Mode when served as text/html, and XML mode when
served as */xml. YAGNI.

> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">

> [...]


> <script type="text/javascript" language="javascript">

^^^^^^^^
Not Valid.

> [...]
> if (window.XMLHttpRequest)

if (typeof XMLHttpRequest != undefined)

(for a start, see isMethod() for more)

> xhttp=new XMLHttpRequest();

Where do you declare this?

> xhttp=new ActiveXObject("Microsoft.XMLHTTP");

You do need to catch exceptions this may throw.

> xhttp.open("GET",dname,false);
> xhttp.send("");

Use

xhttp.open("GET", dname, true);
xhttp.onreadystatechange = function (x) {
// ...
};
x.send(null);

as suggested. At least don't pass "".

> xmlDoc=loadXMLDoc(url_file);

Where do you declare this?

> for (var i=0; i < groupXml.length; i++) {

-----------------------------------^
Syntax error, not well-formed. <http://validator.w3.org/>

> document.forms['searchForm'].groups.options[i] =
> new
> Option(groupXml[i].firstChild.nodeValue,groupXml[i].firstChild.nodeValue);

That's a *bit* inefficient.

BTW, Internet Explorer does not support XHTML.

Please leave an attribution line for each included quotation level.


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

Thomas 'PointedEars' Lahn

unread,
Apr 22, 2010, 1:21:05 PM4/22/10
to
Thomas 'PointedEars' Lahn wrote:

> foka wrote:
>> [...]
>> if (window.XMLHttpRequest)
>
> if (typeof XMLHttpRequest != undefined)

if (typeof XMLHttpRequest != "undefined")



> (for a start, see isMethod() for more)

But for local files (file://) you must prefer ActiveXObject() as
XMLHttpRequest(), if supported, does not support file:// in MSHTML.


PointedEars

foka

unread,
Apr 22, 2010, 1:28:58 PM4/22/10
to
> Use
>
> xhttp.open("GET", dname, true);
> xhttp.onreadystatechange = function (x) {
> // ...
> };
> x.send(null);
>
> as suggested. At least don't pass "".
>
>> xmlDoc=loadXMLDoc(url_file);


I found this here: from http://www.w3schools.com/xml/xml_parser.asp

if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else // Internet Explorer 5/6
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET","books.xml",false);
xhttp.send("");
xmlDoc=xhttp.responseXML;


foka

VK

unread,
Apr 22, 2010, 1:42:10 PM4/22/10
to
On Apr 22, 8:50 pm, foka <crazys...@onet.eu> wrote:
> My javascript function:
>
> function loadXMLDoc(dname)
> {
>      if (window.XMLHttpRequest)
>      {
>          xhttp=new XMLHttpRequest();
>      }
>      else
>      {
>          xhttp=new ActiveXObject("Microsoft.XMLHTTP");
>      }
>      xhttp.open("GET",dname,false);
>      xhttp.send("");
>      return xhttp.responseXML;
>
> }
>
> What u suggest to correct? What and where to add?

Nothing really. I just recalled another oops for local files:
responseXML gets triggered and filled only if XML data is served with
the proper Content-Type like "text/xml", otherwise responseXML remains
empty. As you cannot send Content-Type for local file, you get no data
into responseXML. Read responseText instead - your data is in there,
but as text/plain of course.
I do recall some enforceContentType or something for request, but
honestly I would just take a time verified AJAX library rather that
reinventing the wheel and hitting all per browser and per situation
bizarrities.

Thomas 'PointedEars' Lahn

unread,
Apr 22, 2010, 1:43:00 PM4/22/10
to
foka wrote:

> [Thomas 'PointedEars' Lahn wrote:]


> > Use
> >
> > xhttp.open("GET", dname, true);
> > xhttp.onreadystatechange = function (x) {
> > // ...
> > };
> > x.send(null);
> >
> > as suggested. At least don't pass "".
>

Now you have learned something.

Please do not remove the attribution lines.


PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann

foka

unread,
Apr 22, 2010, 2:00:55 PM4/22/10
to

> Please do not remove the attribution lines.
>
>
> PointedEars

So what to do exactly?
How to fix this?

First: How to load XML file correctly?
Second: How to put XML data into <select> options.
Last: How to work with this localy.

I have other sites and there I use XML and DOM method, and everything is
working ok localy in Opera, IE, Chrome, Firefox
but
in this example when I put data to new object (new Option) this is not
working.
Could u write me some correct example.

foka

foka

unread,
Apr 22, 2010, 2:03:24 PM4/22/10
to
I found this:

...
for (i=0;i<x.length;i++)
...

here: http://www.w3schools.com/xml/xml_to_html.asp

So why u wrote that this "<" is not correct?

Thomas 'PointedEars' Lahn

unread,
Apr 22, 2010, 2:38:09 PM4/22/10
to
foka wrote:

> I found this:
>
> ...
> for (i=0;i<x.length;i++)
> ...
>
> here: http://www.w3schools.com/xml/xml_to_html.asp

AISB, you don't want to use w3schools.com as reference.
(Hint: w3schools.com has nothing to do with w3.org).

> So why u wrote that this "<" is not correct?

Because you have an XHTML document. Learn to read (and to post).


PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16

CrazySeal

unread,
Apr 22, 2010, 4:00:58 PM4/22/10
to
I modyfied my code a little and on server is working but on local
(without apache) my <select> is empty:

My code:
<html>


<head>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"/>

<title>Some</title>
<link rel="stylesheet" type="text/css" href="css/print.css"


media="screen" />
<script type="text/javascript">

function getXMLHttpRequest() {
var request = false;
try {
request = new XMLHttpRequest();
} catch(err1) {
try {
request = new ActiveXObject('Msxml2.XMLHTTP');
} catch(err2) {
try {
request = new
ActiveXObject('Microsoft.XMLHTTP');
} catch(err3) {
request = false;
}
}
}
return request;
}
function showGroups() {
var x = r.responseXML.getElementsByTagName("group");
for (var i=0; i < x.length; i++) {


document.forms['searchForm'].groups.options[i] =

new Option(x[i].firstChild.nodeValue,x[i].firstChild.nodeValue);
}
}
</script>
</head>
<body>
<div id="content">
<form id="searchForm" action="" method="get"
onSubmit="">


<select name="groups" class="groups">
</select>
<input class="submit" type="submit"
value="Szukaj" />

</form>
</div>
</body>
</html>
<script type="text/javascript">
var r;
r = getXMLHttpRequest();
r.open('GET', '../xml/groups.xml', true);
r.onreadystatechange = showGroups;
r.send(null);
</script>

XML file:


<?xml version="1.0" encoding="UTF-8"?>

<items>
<item>
<group>AK</group>

<name>Some Ak</name>


</item>
<item>
<group>BZ</group>

<name>Some BZ</name>
</item>
</items>

Could somebody help me? what to change to run this site without
apache.

Foka

VK

unread,
Apr 22, 2010, 4:13:01 PM4/22/10
to
On Apr 23, 12:00 am, CrazySeal <mariusz.barty...@gmail.com> wrote:
> Could somebody help me? what to change to run this site without
> apache.

You question is already answered in my last post. Simply replace


var x = r.responseXML.getElementsByTagName("group");

to
window.alert(r.responseText)
to see it.


VK

unread,
Apr 22, 2010, 4:18:44 PM4/22/10
to

Have no idea if it still works and how widely/properly supported (we
are using our own parsing library), but try:

r = getXMLHttpRequest();
r = setRequestHeader('Content-Type', 'text/xml'); // <-

VK

unread,
Apr 22, 2010, 4:20:11 PM4/22/10
to
On Apr 23, 12:18 am, VK <schools_r...@yahoo.com> wrote:
>    r = setRequestHeader('Content-Type', 'text/xml'); // <-

damn... I mean:

r.setRequestHeader('Content-Type', 'text/xml');

VK

unread,
Apr 22, 2010, 4:27:26 PM4/22/10
to

double damn... Sorry, did not work with XHR object directly for year.
Forget the above, try:

r.overrideMimeType('text/xml')

instead

foka

unread,
Apr 22, 2010, 4:32:18 PM4/22/10
to
VK pisze:

> r.setRequestHeader('Content-Type', 'text/xml');


Not working.
Now I have error when I run site on server, and my <select> list is empty:

uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.setRequestHeader]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
http://techrol.local/index.html :: <TOP_LEVEL> :: line 108" data: no]

and error when I run site localy:

uncaught exception: [Exception... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.setRequestHeader]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
file:///C:/wamp/www/techrol/index.html :: <TOP_LEVEL> :: line 108" data: no]

line 108: r.setRequestHeader('Content-Type', 'text/xml');

any other Idea?

Foka

Thomas 'PointedEars' Lahn

unread,
Apr 22, 2010, 4:32:58 PM4/22/10
to
CrazySeal wrote:
^^^^^^^^^
So now you're a name-switcher, too? :-(

> I modyfied my code a little and on server is working but on local
> (without apache) my <select> is empty:
>
> My code:

> [...]


> function getXMLHttpRequest() {
> var request = false;
> try {
> request = new XMLHttpRequest();
> } catch(err1) {
> try {
> request = new ActiveXObject('Msxml2.XMLHTTP');
> } catch(err2) {
> try {
> request = new
> ActiveXObject('Microsoft.XMLHTTP');
> } catch(err3) {
> request = false;
> }
> }
> }
> return request;
> }

> [...]


> Could somebody help me? what to change to run this site without
> apache.

<news:1856377.5...@PointedEars.de>

CrazySeal

unread,
Apr 22, 2010, 4:37:08 PM4/22/10
to
On 22 Kwi, 22:32, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:

> CrazySeal wrote:
>
> ^^^^^^^^^
> So now you're a name-switcher, too? :-(
>
Sometimes I wrote using Google news group, and sometimes using
Thunderbird. Depends what is actualy opened.
My name is always the same: CrazySeal or foka means the same.
Seal means foka in Polish :)

can u help me with this Ajax code?

CrazySeal

unread,
Apr 22, 2010, 4:44:47 PM4/22/10
to
On firefox I receive error:

Access to restricted URI denied" code: "1012
in line:
r.send(null);

Is any chance to fix this?

Foka

Thomas 'PointedEars' Lahn

unread,
Apr 22, 2010, 4:49:23 PM4/22/10
to
CrazySeal wrote:

> [changing nickname]

I don't care what your nickname means, or what you are posting with.
Use *one* *real* name here, and write in readable English or whatever
language you are capable of.

> can u help me with this Ajax code?

^
No, apparently you're too stupid to post questions and to read my answers.

<http://www.catb.org/~esr/faqs/smart-questions.html>

CrazySeal

unread,
Apr 22, 2010, 5:01:15 PM4/22/10
to
Ok. So please, do not post more on this topic.
Maybe I don't know English well, so what?
If you don't want to, or can't help, just don't post.
Easy.

But maybe someone knows how can I solve this problem.

Ps. I do not care if you are interested in my nickname. I answered
your question but culturally.

Foka

David Mark

unread,
Apr 23, 2010, 2:47:10 AM4/23/10
to

Triple damn. That won't work in IE unless you use the ActiveX XHR
variety (and the user allows ActiveX to run). Your scatter-shot method
of problem solving isn't working.

Some things never change.

Garrett Smith

unread,
Apr 23, 2010, 3:43:32 AM4/23/10
to
David Mark wrote:
> VK wrote:
>> On Apr 23, 12:20 am, VK <schools_r...@yahoo.com> wrote:
>>> On Apr 23, 12:18 am, VK <schools_r...@yahoo.com> wrote:
>>>

[...]

>>
>> r.overrideMimeType('text/xml')
>>

Not implemented in IE.

>
> Triple damn. That won't work in IE unless you use the ActiveX XHR
> variety (and the user allows ActiveX to run). Your scatter-shot method
> of problem solving isn't working.
>

Is yours?

var a = new ActiveXObject("Microsoft.XMLHTTP");
alert(typeof a.overrideMimeType);

"undefined"

If the discussion is about loading a local file off the filesystem (and
it is), then that isn't going to work very well using XMLHttpRequest, is it?

[1]http://www.w3.org/TR/XMLHttpRequest/#introduction
--
Garrett
comp.lang.javascript FAQ: http://jibbering.com/faq/

Garrett Smith

unread,
Apr 23, 2010, 3:56:11 AM4/23/10
to
foka wrote:
> Hi.I have got a problem with javascript and XML.
> I want to put data from XML file to HTML <select> options.
> My code is working but only if I put this (websites) on server, but I
> want to run my html site on every comp, localy, for example from CD., on
> windows without Apache etc.
> When I run my site localy file:///C:/file.html then my <select> is empty.
>
> My Ajax code:

As you have noticed, some browsers support file protocol with
XMLHttpRequest and IE doesn't. The ActiveXObject constructor does
support that.

You're attemtping to use XMLHttpRequest for something it was not
designed for. XMLHttpRequest is in Working Draft status, and is
specified therein for http and https only[1].

You might want to try XMLDocument[2], however that is going to depend on
the security settings of IE. Perhaps someone can provide the fine
details of that, as well as indicate the proper progids to try.

Example:

<script type="text/javascript">
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.load("items.xml");
if(xmlDoc.parseError.errorCode != 0) {
alert("Error" + xmlDoc.parseError.errorCode);
} else {
document.write("Your XML File, items.xml:<xmp>", xmlDoc.xml);
}
</script>

[1]<http://www.w3.org/TR/XMLHttpRequest/#introduction>
[2]<http://msdn.microsoft.com/en-us/library/ms757828(v=VS.85).aspx>

VK

unread,
Apr 23, 2010, 4:18:19 AM4/23/10
to
On Apr 23, 10:47 am, David Mark <dmark.cins...@gmail.com> wrote:
> Your scatter-shot method
> of problem solving isn't working.

Baby, this is why I said at first to OP "I would just take a time


verified AJAX library rather that reinventing the wheel and hitting

all per browser and per situation bizarrities." I didn't work with
XMLHttpRequest directly for years by now and no one serious did. Can
you recall when the last time you directly programmed CGI input
handling REQUEST_METHOD, QUERY_STRING, CONTENT_LENGTH etc? Or manually
forming TCP/IP packets for HTTP requests? Surely it is still on tips
of your fingers, right?

0 instead of 200 for status and empty responseXML for local files
reading is a long standing XHR silliness and any more or less descent
lib handles it over particular wrappers. Long time I was promoting
AjaxRequest by Matt Kruse http://www.ajaxtoolbox.com/request/ but the
project is abandoned for years and the last version never fixed the "0
instead 200" workaround I reported back in 2005 at least, so for local
files responseText needs to be read from onError listener rather than
from onSuccess. That kind of prevent from promoting it in this case.

So any AjaxRequest-like library? Yes, to be universal it has to use
responseText only for local files and then serialize it back to XML if
XML is needed. I am just bored to post 1001st explanation of something
being done in so many libraries.


Thomas 'PointedEars' Lahn

unread,
Apr 23, 2010, 7:49:23 AM4/23/10
to
Garrett Smith wrote:

> foka wrote:
>> Hi.I have got a problem with javascript and XML.
>> I want to put data from XML file to HTML <select> options.
>> My code is working but only if I put this (websites) on server, but I
>> want to run my html site on every comp, localy, for example from CD., on
>> windows without Apache etc.
>> When I run my site localy file:///C:/file.html then my <select> is empty.
>>
>> My Ajax code:
>
> As you have noticed, some browsers support file protocol with
> XMLHttpRequest and IE doesn't. The ActiveXObject constructor does
> support that.

Correct.

> You're attemtping to use XMLHttpRequest for something it was not
> designed for. XMLHttpRequest is in Working Draft status, and is
> specified therein for http and https only[1].

Utter nonsense. When will you ever learn? The fact that a *draft*
specifies something has absolutely no intrinsic meaning at all. Which is
emphasized by the mere fact that XMLHttpRequest works for non-http and non-
https URLs outside of MSHTML, i.e. in the majority of implementations, where
some of them support considerable portions of the draft.

MSHTML 8 in IE 8 supports but one feature of HTML 5 as specified in the
draft, and it is not XMLHttpRequest.¹ It is illogical to conclude that
XMLHttpRequest works so in MSHTML because it *might* become so in HTML 5.

¹ <http://blogs.msdn.com/giorgio/archive/2009/11/29/ie8-and-html-5.aspx>



> You might want to try XMLDocument[2], however that is going to depend on
> the security settings of IE. Perhaps someone can provide the fine
> details of that, as well as indicate the proper progids to try.

For maximum compatibility, you only need to try one. The load() method, as
well as the loadXML() method, is available since MSXML 3.0.



> Example:
>
> <script type="text/javascript">
> var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

> xmlDoc.async = false;
> xmlDoc.load("items.xml");

xmlDoc.loadXML(xhr.responseText);

(as written in numerous tutorials, and several FAQs, since years ago).

> [...]
> [2]<http://msdn.microsoft.com/en-us/library/ms757828(v=VS.85).aspx>

<http://msdn.microsoft.com/en-us/library/ms754585%28VS.85%29.aspx>

(but note that the ProgID in the example is not compatible)

Garrett Smith

unread,
Apr 24, 2010, 2:40:00 AM4/24/10
to
Thomas 'PointedEars' Lahn wrote:
> Garrett Smith wrote:
>
>> foka wrote:
>>> Hi.I have got a problem with javascript and XML.
>>> I want to put data from XML file to HTML <select> options.
>>> My code is working but only if I put this (websites) on server, but I
>>> want to run my html site on every comp, localy, for example from CD., on
>>> windows without Apache etc.
>>> When I run my site localy file:///C:/file.html then my <select> is empty.
>>>
>>> My Ajax code:
>> As you have noticed, some browsers support file protocol with
>> XMLHttpRequest and IE doesn't. The ActiveXObject constructor does
>> support that.
>
> Correct.
>
>> You're attemtping to use XMLHttpRequest for something it was not
>> designed for. XMLHttpRequest is in Working Draft status, and is
>> specified therein for http and https only[1].
>
> Utter nonsense. When will you ever learn? The fact that a *draft*
> specifies something has absolutely no intrinsic meaning at all. Which is
> emphasized by the mere fact that XMLHttpRequest works for non-http and non-
> https URLs outside of MSHTML, i.e. in the majority of implementations, where
> some of them support considerable portions of the draft.
>

The fact that I wrote that: "XMLHttpRequest is in Working Draft status"
indicates that it is a *draft*. You called that "utter nonsense", then
stated that it is a draft and asked me when I will ever learn. Well I
already knew that when I wrote it. It sounds like you are being
ridiculous and and self contradictory.

Should XMLHttpRequest use "file:///" or "file://" or "[drive]:\"? Or is
it limited to relative paths? If so, what is the file separator? Is the
browser expected to map "/" to the separator for that OS? Or should the
code not expect that "/" gets mapped to "\" or ":" (or (hopefully
not)"." or ">")? What about navigating to parent directories?

File protocol for browser-based applications is not specified. Maybe one
day it will be but for now it is not. Nor is behavior of file protocol
well-documented.

A good first place to start for determining recommendation for file
protocol would be to write a test suite and run existing implementations
through it to see how they behave.

> MSHTML 8 in IE 8 supports but one feature of HTML 5 as specified in the
> draft, and it is not XMLHttpRequest.¹ It is illogical to conclude that
> XMLHttpRequest works so in MSHTML because it *might* become so in HTML 5.
>
> ¹ <http://blogs.msdn.com/giorgio/archive/2009/11/29/ie8-and-html-5.aspx>
>

Is there a point in linking to that blog?

[...]

>> Example:
>>
>> <script type="text/javascript">
>> var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
>
> var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
>
>> xmlDoc.async = false;
>> xmlDoc.load("items.xml");
>
> xmlDoc.loadXML(xhr.responseText);

That would require creating two ActiveX objects; one for the request and
one for the parsing of the xhr responseText into a document.

Whereas if load is used, only one ActiveX object is needed.
[...]

VK

unread,
Apr 24, 2010, 2:59:28 AM4/24/10
to
On Apr 24, 10:40 am, Garrett Smith <dhtmlkitc...@gmail.com> wrote:
> Whereas if load is used, only one ActiveX object is needed.

For IE even more simple way could be by using XML Data Islands and
overloading <script> element:
http://msdn.microsoft.com/en-us/library/ms766512(VS.85).aspx

"A good first place to start for determining recommendation for file
protocol would be to write a test suite and run existing
implementations
through it to see how they behave."

That is a great idea - strange it was not done yet and
http://www.jibbering.com/faq/#ajaxRef is dead silent about this very
common XHR use.

VK

unread,
Apr 24, 2010, 3:18:31 AM4/24/10
to
On Apr 24, 10:40 am, Garrett Smith <dhtmlkitc...@gmail.com> wrote:
> Should XMLHttpRequest use "file:///" or "file://" or "[drive]:\"? Or is
> it limited to relative paths? If so, what is the file separator? Is the
> browser expected to map "/" to the separator for that OS? Or should the
> code not expect that "/" gets mapped to "\" or ":" (or (hopefully
> not)"." or ">")? What about navigating to parent directories?

This matter is not as complex as being put. XHR operates over HTTP
interface and doesn't have access to local file system-level
interfaces. This way:
1) No, absolute path cannot be used in any form, neither in system-
dependent nor in browser-dependent nor in some universal one.
2) For relative path the regular HTML syntax must be used with '..'
for directory up and '/' for directory down.
'.' for root is not supported for the reason see point 1)

Thomas 'PointedEars' Lahn

unread,
Apr 24, 2010, 1:22:29 PM4/24/10
to
Garrett Smith wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Garrett Smith wrote:
>>> You're attemtping to use XMLHttpRequest for something it was not
>>> designed for. XMLHttpRequest is in Working Draft status, and is
>>> specified therein for http and https only[1].
>> Utter nonsense. When will you ever learn? The fact that a *draft*
>> specifies something has absolutely no intrinsic meaning at all. Which is
>> emphasized by the mere fact that XMLHttpRequest works for non-http and
>> non- https URLs outside of MSHTML, i.e. in the majority of
>> implementations, where some of them support considerable portions of the
>> draft.
>
> The fact that I wrote that: "XMLHttpRequest is in Working Draft status"
> indicates that it is a *draft*. You called that "utter nonsense", then
> stated that it is a draft and asked me when I will ever learn. Well I
> already knew that when I wrote it. It sounds like you are being
> ridiculous and and self contradictory.

No, you are. You are referring to a draft as the justification for an
implementation when that implementation has nothing to do with the draft,
and it is not appropriate to refer to a Working Draft as other than work
in progress. Apparently you'll never learn.

> [snip more nonsense]


>> MSHTML 8 in IE 8 supports but one feature of HTML 5 as specified in the
>> draft, and it is not XMLHttpRequest.¹ It is illogical to conclude that
>> XMLHttpRequest works so in MSHTML because it *might* become so in HTML 5.
>>
>> ¹ <http://blogs.msdn.com/giorgio/archive/2009/11/29/ie8-and-html-5.aspx>
>>
> Is there a point in linking to that blog?

Yes. If you could read ...

> [...]
>>> Example:
>>>
>>> <script type="text/javascript">
>>> var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
>>
>> var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
>>
>>> xmlDoc.async = false;
>>> xmlDoc.load("items.xml");
>>
>> xmlDoc.loadXML(xhr.responseText);
>
> That would require creating two ActiveX objects; one for the request and
> one for the parsing of the xhr responseText into a document.

Yes.



> Whereas if load is used, only one ActiveX object is needed.
> [...]

But the approach that uses two objects when necessary does not require a
complete rewrite for the version that also works with the local filesystem,
and it would not require those additional permissions you have talked about.

Garrett Smith

unread,
Apr 24, 2010, 5:34:10 PM4/24/10
to
Thomas 'PointedEars' Lahn wrote:
> Garrett Smith wrote:
>
>> Thomas 'PointedEars' Lahn wrote:
>>> Garrett Smith wrote:
>>>> You're attemtping to use XMLHttpRequest for something it was not
>>>> designed for. XMLHttpRequest is in Working Draft status, and is
>>>> specified therein for http and https only[1].
>>> Utter nonsense. When will you ever learn? The fact that a *draft*
>>> specifies something has absolutely no intrinsic meaning at all. Which is
>>> emphasized by the mere fact that XMLHttpRequest works for non-http and
>>> non- https URLs outside of MSHTML, i.e. in the majority of
>>> implementations, where some of them support considerable portions of the
>>> draft.
>> The fact that I wrote that: "XMLHttpRequest is in Working Draft status"
>> indicates that it is a *draft*. You called that "utter nonsense", then
>> stated that it is a draft and asked me when I will ever learn. Well I
>> already knew that when I wrote it. It sounds like you are being
>> ridiculous and and self contradictory.
>
> No, you are. You are referring to a draft as the justification for an
> implementation when that implementation has nothing to do with the draft,
> and it is not appropriate to refer to a Working Draft as other than work
> in progress. Apparently you'll never learn.
>

False, presumptuous bullshit.

I referred to a w3c working draft. That much is true.

You wrote that I did so in "justification for an implementation."

That is false. I did not mention an implementation.

You stated that I did so "when the implementation has nothing to with
the draft.".

That is false. I did not mention an implementation.
I wrote:

| You're attemtping to use XMLHttpRequest for something it was not
| designed for.

[...]

Thomas 'PointedEars' Lahn

unread,
Apr 25, 2010, 5:05:25 PM4/25/10
to
Garrett Smith wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Garrett Smith wrote:
>>> Thomas 'PointedEars' Lahn wrote:
>>>> Garrett Smith wrote:
>>>>> You're attemtping to use XMLHttpRequest for something it was not
>>>>> designed for. XMLHttpRequest is in Working Draft status, and is
>>>>> specified therein for http and https only[1].
>>>> Utter nonsense. When will you ever learn? The fact that a *draft*
>>>> specifies something has absolutely no intrinsic meaning at all. Which
>>>> is emphasized by the mere fact that XMLHttpRequest works for non-http
>>>> and non- https URLs outside of MSHTML, i.e. in the majority of
>>>> implementations, where some of them support considerable portions of
>>>> the draft.
>>> The fact that I wrote that: "XMLHttpRequest is in Working Draft status"
>>> indicates that it is a *draft*. You called that "utter nonsense", then
>>> stated that it is a draft and asked me when I will ever learn. Well I
>>> already knew that when I wrote it. It sounds like you are being
>>> ridiculous and and self contradictory.
>>
>> No, you are. You are referring to a draft as the justification for an
>> implementation when that implementation has nothing to do with the draft,
>> and it is not appropriate to refer to a Working Draft as other than work
>> in progress. Apparently you'll never learn.
>
> False, presumptuous bullshit.

There is no presumption, stupid. You *wrote* it.

> I referred to a w3c working draft. That much is true.
>
> You wrote that I did so in "justification for an implementation."
>
> That is false. I did not mention an implementation.

Yes, you did: "IE", i.e. the MSXML.



> You stated that I did so "when the implementation has nothing to with
> the draft.".
>
> That is false. I did not mention an implementation.

Yes, you did.

> I wrote:
>
> | You're attemtping to use XMLHttpRequest for something it was not
> | designed for.

And going on with saying that the draft would specify the behavior that "IE"
exhibits. How is that *not* justifying the implementation with the draft?


PointedEars
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300...@news.demon.co.uk> (2004)

VK

unread,
Apr 25, 2010, 5:33:19 PM4/25/10
to
See for details
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/56bcdb1f5051ef97


I guess now it should be finally answered to the foka's OP that
started this:


1) OP path "../xml/groups.xml" is not universally possible because Fx
allows to read only in the same directory and subdirectories, but not
in top or sibling directories. So the directory structure has to be
arganized accordingly.

2) Let's have XML data in groups.xml file like this:

<?xml version="1.0" encoding="UTF-8"?>
<items>
<item>
<group>AK</group>

<name>COS AK</name>


</item>
<item>
<group>BZ</group>

<name>COS BZ</name>
</item>
<item>
<group>CA</group>
<name>COS CA</name>
</item>
</items>

3) Let's have a HTML page with the script in the same directory where
groups.xml is. Then to read XML data and to populate select form
element on the page the script could be like this (tested IE6, IE8,
Fx, Sf, Ch, Op):

<!DOCTYPE html>
<html>
<head>
<title>XMLHttpRequest local XML file reading test</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<script type="text/javascript">

function getAjaxObject(forLocalData) {

var f = arguments.callee;

var isIE = /*@cc_on true || @*/ false;

var xhr = null;

if (typeof window == 'object') {

/* Common branch for modern browsers */
if (
(typeof window.XMLHttpRequest != 'undefined') &&
/* window.XMLHttpRequest instances in IE do not
* have local file access even from local pages,
* unlike ActiveX instances: so if forLocalData
* flag set, we are trying to use the underlaying
* ActiveX constructor.
*/
( !(isIE && forLocalData) )
) {
try {
return new window.XMLHttpRequest();
}
catch(e) {
return new Error(e.message);
}
}

/* ActiveX branch for old IE versions and
* for local data access capable instances. See:
* 1) http://tinyurl.com/MSDNBlog1
* 2) http://tinyurl.com/MSNewsGroup1
* 3) http://tinyurl.com/MSDNBlog2
* for proper ProgID and proper ProgID trying sequence.
*
* Correction from the test lab: contrary to what MS says
* and in support of my arguments at 2) discission a set
* of machines with IE6 / Win XP SP2 in default installation
* failed to puck up on Msxml2.XMLHTTP.3.0 so used the older
* version: yet they happily picked up on Msxml2.XMLHTTP.4.0
* Whatever the exact reasons of it are, a branch for 4.0
* is added to ensure the newest version usage in all
* given circumstances.
*/
else if (
(isIE) &&
/* if IE 5.x for MacOS without ActiveX: */
(typeof window.ActiveXObject != 'undefined')
) {
try {
xhr = new window.ActiveXObject('Msxml2.XMLHTTP.6.0');
f.isActiveX = true;
f.ActiveXVersion = 6;
return xhr;
}
catch(e) {
try {
xhr = new window.ActiveXObject('Msxml2.XMLHTTP.3.0');
/* Contrary to numerous MS claims like here:
* http://tinyurl.com/SelectionLanguage
* Msxml2.XMLHTTP.3.0 (IE6 / Win XP SP2 by default)
* does not have XSL Patterns as the default language
* neither it supports setProperty method so trying
* to apply setProperty("SelectionLanguage", "XPath")
* leads to "not supported" runtime error on IE6.
* In the reality the last COM with XSL Patterns were
* in XMLHTTP.2.x versions. Looks pretty much as a MS
* internal urban legend.
*/
f.isActiveX = true;
f.ActiveXVersion = 3;
return xhr;
}
catch(e) {
/* As per MS Security Bulletin http://tinyurl.com/MS06-061
* Msxml2.XMLHTTP.2.x and older like Microsoft.XMLHTTP can
* be blocked and overall the security considerations
* should prevail over the maximum backward compatibility.
* Add these branches only if you really need to support
* IE 5.x in a non-commercial home use solution.
*/
return new Error(e.message);
}
}
}
/* If nothing then nothing... */
else {
return new Error('ActiveX is missing or blocked');
}
}
else {
return new Error('window host object is missing');
}
}


window.onload = function() {
document.forms[0].reset();
window.setTimeout('test()', 10);
}


function test() {

var isIE = /*@cc_on true || @*/ false;

var wantXML = true;

var xmlDoc = null; var tmp = null;

if ((xhr = getAjaxObject(true)) instanceof Error) {
window.alert('Couldn\'t instantiate XHR:\n' + xhr.message);
return;
}

if (loadData('groups.xml') instanceof Error) {
window.alert('Couldn\'t read data:\n' + xhr.message);
return;
}

if (isIE && wantXML) {
tmp = document.createElement('DIV');
tmp.innerHTML = '<XML>'+xhr.responseText+'</XML>';
xmlDoc = tmp.firstChild.XMLDocument.documentElement;
}
else {
xmlDoc = xhr.responseXML;
}

var out = document.forms[0].groups;
var groupXml = xmlDoc.getElementsByTagName('group');
for (var i=0; i<groupXml.length; i++) {
out.options[i] = new Option(groupXml[i].firstChild.nodeValue,
groupXml[i].firstChild.nodeValue);
}

function loadData(path, wantXML) {
try {
xhr.open('GET', path, false);
xhr.send('');
}
catch(e) {
return new Error(e.message);
}
}
}
</script>
</head>

<body>
<h1>XMLHttpRequest local XML file reading test</h1>
<form action="" onsubmit="return false;">
<fieldset>
<select name="groups">
</select>
</fieldset>
</form>
</body>
</html>

VK

unread,
Apr 25, 2010, 6:30:21 PM4/25/10
to
On Apr 26, 1:30 am, VK <schools_r...@yahoo.com> wrote:
> *
> * Correction from the test lab: contrary to what MS says
> * and in support of my arguments at 2) discission a set
> * of machines with IE6 / Win XP SP2 in default installation
> * failed to puck up on Msxml2.XMLHTTP.3.0 so used the older
> * version: yet they happily picked up on Msxml2.XMLHTTP.4.0
> * Whatever the exact reasons of it are, a branch for 4.0
> * is added to ensure the newest version usage in all
> * given circumstances.

Please disregard this comment: that was a false alarm from an altered
configuration. I thought I deleted it but obviously I didn't. Sorry.

Garrett Smith

unread,
Apr 26, 2010, 1:43:57 PM4/26/10
to

I wrote "it"? What "it"? I wrote exactly what I wrote. Here again:

| You're attemtping to use XMLHttpRequest for something it was not
| designed for. XMLHttpRequest is in Working Draft status, and is
| specified therein for http and https only[1].

You quoted that and responded that with presumptuous lies, trying to
prove that I am stupid and wrong. Hence, ridiculous and self-contradictory.

My name is not stupid and I am not stupid. In fact, I provided a
workable solution to the OPs problem despite pointless, pedantic
interruptions from a worthless man named Thomas Lahn.

>> I referred to a w3c working draft. That much is true.
>>
>> You wrote that I did so in "justification for an implementation."
>>
>> That is false. I did not mention an implementation.
>
> Yes, you did: "IE", i.e. the MSXML.
>

That paragraph does not mention "IE" or "the MSXML".

>> You stated that I did so "when the implementation has nothing to with
>> the draft.".
>>
>> That is false. I did not mention an implementation.
>
> Yes, you did.
>

No, I did not. The entire paragraph, once more:

| You're attemtping to use XMLHttpRequest for something it was not
| designed for. XMLHttpRequest is in Working Draft status, and is
| specified therein for http and https only[1].

I stand by that entirely.

That paragraph does not mention MSXML; MSXML is unrelated to
XMLHttpRequest, and unrelated to what is noticed about XMLHttpRequest,
which is linked in the footnote[1]:-

| [1]<http://www.w3.org/TR/XMLHttpRequest/#introduction>

>> I wrote:
>>
>> | You're attemtping to use XMLHttpRequest for something it was not
>> | designed for.
>
> And going on with saying that the draft would specify the behavior that "IE"
> exhibits. How is that *not* justifying the implementation with the draft?
>

That paragraph mentions nothing about the behavior of "IE". Therefore,
it is not justifying the implementation with the draft.

Thomas 'PointedEars' Lahn

unread,
Apr 27, 2010, 6:23:49 AM4/27/10
to
Garrett Smith wrote:

> | You're attemtping to use XMLHttpRequest for something it was not
> | designed for. XMLHttpRequest is in Working Draft status, and is
> | specified therein for http and https only[1].
>

> I stand by that entirely.
>
> That paragraph does not mention MSXML;

It is referring explicitly to XMLHttpRequest behavior in "IE", though.

> MSXML is unrelated to XMLHttpRequest,

No, it is not. But more important is that "IE" is not unrelated to
"XMLHttpRequest", by your own account.

> and unrelated to what is noticed about XMLHttpRequest, which is linked in
> the footnote[1]:-
>
> | [1]<http://www.w3.org/TR/XMLHttpRequest/#introduction>

Once more, for the intellectually challenged: By saying that someone who
uses XMLHttpRequest in "IE" "attempted to use XMLHttpRequest for something
it was not designed for", when that something was local file access via
`file', and then stating that "XMLHttpRequest [...] is specified [in the
Working Draft [...] for `http' or `https' only" is undoubtedly justifying
the (way the) implementation (in "IE" works) with the draft.

And that is a fallacy, because a) the implementation is not based on the
draft; and b) it is a *Working Draft*, nothing more:

| Publication as a Working Draft does not imply endorsement by the W3C
| Membership. This is a draft document and may be updated, replaced or
| obsoleted by other documents at any time. It is inappropriate to cite
^^^^^^^^^^^^^^^^^^^^^^^^^^^
| this document as other than work in progress.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

There is no way for you to wind around that.



>>> I wrote:
>>>
>>> | You're attemtping to use XMLHttpRequest for something it was not
>>> | designed for.
>>
>> And going on with saying that the draft would specify the behavior that
>> "IE" exhibits. How is that *not* justifying the implementation with the
>> draft?
>
> That paragraph mentions nothing about the behavior of "IE". Therefore,
> it is not justifying the implementation with the draft.

Wrong. And I presume you already know that, but do not want to admit it.
You are pitiful.

foka

unread,
Apr 27, 2010, 7:05:31 AM4/27/10
to
THNKS :)

regards
foka

VK pisze:


--
Pozdrawiam
Mariusz Bartyzel

---------------------
www.reservoirdogs.pl

Branco

unread,
Apr 27, 2010, 10:49:45 AM4/27/10
to
Thomas 'PointedEars' Lahn wrote:
> Garrett Smith wrote:
> > | You're attemtping to use XMLHttpRequest for something it was not
> > | designed for. XMLHttpRequest is in Working Draft status, and is
> > | specified therein for http and https only[1].
<snip>

> Once more, for the intellectually challenged: By saying that someone who
> uses XMLHttpRequest in "IE" "attempted to use XMLHttpRequest for something
> it was not designed for", when that something was local file access via
> `file', and then stating that "XMLHttpRequest [...] is specified [in the
> Working Draft [...] for `http' or `https' only" is undoubtedly justifying
> the (way the) implementation (in "IE" works) with the draft.

<snip>

That has to be the worst attempt I ever saw of trying to win an
argument by twisting the fabrics of reality.

Y, S, AAI.

Regards,

Branco.

Garrett Smith

unread,
Apr 27, 2010, 3:43:37 PM4/27/10
to
Thomas 'PointedEars' Lahn wrote:
> Garrett Smith wrote:
>
>> | You're attemtping to use XMLHttpRequest for something it was not
>> | designed for. XMLHttpRequest is in Working Draft status, and is
>> | specified therein for http and https only[1].
>>
>> I stand by that entirely.
>>
>> That paragraph does not mention MSXML;
>
> It is referring explicitly to XMLHttpRequest behavior in "IE", though.
>

No, it is not.

>> MSXML is unrelated to XMLHttpRequest,
>
> No, it is not. But more important is that "IE" is not unrelated to
> "XMLHttpRequest", by your own account.
>
>> and unrelated to what is noticed about XMLHttpRequest, which is linked in
>> the footnote[1]:-
>>
>> | [1]<http://www.w3.org/TR/XMLHttpRequest/#introduction>
>
> Once more, for the intellectually challenged: By saying that someone who
> uses XMLHttpRequest in "IE" "attempted to use XMLHttpRequest for something
> it was not designed for", when that something was local file access via
> `file', and then stating that "XMLHttpRequest [...] is specified [in the
> Working Draft [...] for `http' or `https' only" is undoubtedly justifying
> the (way the) implementation (in "IE" works) with the draft.
>

You're making this up.

> And that is a fallacy, because a) the implementation is not based on the
> draft; and b) it is a *Working Draft*, nothing more:
>

So you're made-up story contains a fallacy? That's your problem.

> | Publication as a Working Draft does not imply endorsement by the W3C
> | Membership. This is a draft document and may be updated, replaced or
> | obsoleted by other documents at any time. It is inappropriate to cite
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> | this document as other than work in progress.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> There is no way for you to wind around that.
>

I stated that it was a draft.

>>>> I wrote:
>>>>
>>>> | You're attemtping to use XMLHttpRequest for something it was not
>>>> | designed for.
>>> And going on with saying that the draft would specify the behavior that
>>> "IE" exhibits. How is that *not* justifying the implementation with the
>>> draft?
>> That paragraph mentions nothing about the behavior of "IE". Therefore,
>> it is not justifying the implementation with the draft.
>
> Wrong. And I presume you already know that, but do not want to admit it.
> You are pitiful.
>

You wrongly misunderstood what I wrote and blamed me for it. What I
wrote was clear and plain as day. How long are you going to carry on
with silly nonsense?

Thomas 'PointedEars' Lahn

unread,
Apr 27, 2010, 4:20:01 PM4/27/10
to
Garrett Smith wrote:

> Thomas 'PointedEars' Lahn wrote:
>> Garrett Smith wrote:
>>> | You're attemtping to use XMLHttpRequest for something it was not
>>> | designed for. XMLHttpRequest is in Working Draft status, and is
>>> | specified therein for http and https only[1].
>>>
>>> I stand by that entirely.
>>>
>>> That paragraph does not mention MSXML;
>> It is referring explicitly to XMLHttpRequest behavior in "IE", though.
>
> No, it is not.

Yes, it is, see below.

>>> MSXML is unrelated to XMLHttpRequest,
>>
>> No, it is not. But more important is that "IE" is not unrelated to
>> "XMLHttpRequest", by your own account.
>>
>>> and unrelated to what is noticed about XMLHttpRequest, which is linked
>>> in the footnote[1]:-
>>>
>>> | [1]<http://www.w3.org/TR/XMLHttpRequest/#introduction>
>>
>> Once more, for the intellectually challenged: By saying that someone who
>> uses XMLHttpRequest in "IE" "attempted to use XMLHttpRequest for
>> something it was not designed for", when that something was local file
>> access via `file', and then stating that "XMLHttpRequest [...] is
>> specified [in the Working Draft [...] for `http' or `https' only" is
>> undoubtedly justifying the (way the) implementation (in "IE" works) with
>> the draft.
>
> You're making this up.

No, your reply (which full context you deliberately omitted) included:

| foka wrote:
| > Hi.I have got a problem with javascript and XML.
| > I want to put data from XML file to HTML <select> options.
| > My code is working but only if I put this (websites) on server, but I
| > want to run my html site on every comp, localy, for example from CD.,
| > on windows without Apache etc.
| > When I run my site localy file:///C:/file.html then my <select> is

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| > empty.
^^^^^^


| >
| > My Ajax code:
|
| As you have noticed, some browsers support file protocol with

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


| XMLHttpRequest and IE doesn't. The ActiveXObject constructor does

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| support that.


|
| You're attemtping to use XMLHttpRequest for something it was not

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


| designed for. XMLHttpRequest is in Working Draft status, and is

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


| specified therein for http and https only[1].

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I have marked the important parts. Do you deny that you wrote this? Do you
deny that the second paragraph of your answer is referring to the first,
which is referring exactly to the OP's problem in IE (or rather your
assumption thereof because of the problems observed)? Do you still deny
that you are justifying the way the implementation in "IE" works (or rather
not works) with what a/the Working Draft has to say about this?

0 new messages