Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loading a big fat local XML file



Whoop. You're right, it's working.
I was trying to simply run the sample <http://developer.apple.com/ internet/webcontent/XMLHttpRequestExample/example.html> locally.
It did not work because it verifies the status of the request, whether the server returns code 200.
Obviously the harddrive does not return anything.
Thanks a lot. I'll need to rewrite my widget from the ground up now. But hopefully then it gets better and more reliable.


Michael

Am 26.08.2006 um 10:43 schrieb Chris O'Brien:

Hi Michael,

"XML HTTP request does not work on local files."

Since when?

var http_req = new XMLHttpRequest();
http_req.open("GET", "50.txt", true);

http_req.onload = function() { mainDiv.innerText = http_req.responseText; };

http_req.send(null);

worked fine for me from within your widget.

// Chris

On 8/26/06, Michael Kwasnicki <email@hidden> wrote: Hi again.

Since the problem with the synchronous and asynchronous system call was solved I run against the next wall. I wanted to use the UNIX command "cat" to load a local XML file into the widget for processing. The UNIX command call seems to have still limitations. Regarding my TestWidget I finally saw that the 50kb file was not loaded completely. Pressing the workaround50 link several times loads more or less of the file than as it was pressed befroe. I've attached my TestWidget to this Post. Now the main view has a scroll bar (yes I know I should have used an apple scroll bar - but it is just for testing purposes). The files 1.txt and 50.txt end with "FIN" when loading 1.txt the file is loaded completely. 50.txt is not. You can scroll all the way down and you won't find the word FIN as you would in TextEdit.

So here again some questions:
1. is there some sort of memory limit ? If so, it can't be a string
size limit in the JavaScript language.
Appending the 1.txt files several times results in a bigger string
as loaded by workaround50.
2. what can I do to load such a huge file into my widget. With huge I
mean up to 128kb.
"cat" does not load them all and XML HTTP request does not work on
local files.


Regards,

Michael

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden
References: 
 >loading a big fat local XML file (From: Michael Kwasnicki <email@hidden>)
 >Re: loading a big fat local XML file (From: "Chris O'Brien" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.