From: Leif W <war...@us...> - 2003-10-07 20:32:30
|
Hello, see below. > ----- Original Message ----- > From: Bruce Tennant > To: DynApi-Help > Sent: Tuesday, October 07, 2003 3:00 PM > Subject: [Dynapi-Help] FileReader, init function, and advice > > > I was wondering what the point of the init function is in the FileReader? > And what would be the best way to get at the string returned by filereader. I also think it looks a bit confusing at first, at least not intuitive. I believe it's just illustrating two things. First, you have a "hook" in the FileReader constructor so you can pass a function as an argument. Second, I think it shows that you can get the contents of the url using the read function. But it's hard for me to absorb, even though there's barely 1kb of code alltogether. You are declaring an instance "fl" of FileReader. You're passing a function "init" which hasn't been defined at this point. In the constructor, you're calling this undefined "init" function, which refers to "fl" which hasn't even been declared yet. Somehow it works. I'm missing some basic understanding of how JavaScript is parsing this. Hopefully someone can explain this to us? > My other question is this. > > What would be the best way to build a page and have only part > of the page update from content on a server? > > In particular, I'd like to have elements in a table update every 30 seconds > or so, based on an SQL DB. If there is a change in value, I'd like to do > some kinda of fancy graphic thingy to point it out (secondary issue). > > Will FileReader be the best approach? I figured I'd need to access some > kind of cgi(perl) or php function that would return a plain text file, maybe > javascript code, with the new data, triggering the fetch from javascript > every 30 seconds or what have you. This I'm not too sure of. > Is filereader the best way to do this or should I try to use one of the > IOElements directly? > > Does anyone know of any issues with Apache and cgi scripts that might > cause this to fail? I'd prefer to stay w/perl over php because of the much > more elegant DBI module in perl. > > Thanks in advance for any advise. The main problem I'd see is the ioelmsrv.pl file isn't fully tested for robustness, so please use it and find any bugs and fix them and post a patch. :-) There's currently no ioelmsrv.soda.pl file. Feel free to translate from one of the other languages. I've sort of been working on these (ASP -> PHP/PL) but have been busy with other little projects and haven't gotten back to these in a while. Leif > -Bruce > > > > www.bluewolverine.com > > > Do you Yahoo!? > The New Yahoo! Shopping - with improved product search |