I may have forgotten some of this.
Is it possible to have a JavaScript function that takes the results of a BROWSE control and opens that HTML file in a separate window of a specific Name (for example, Window_File)?
Is it possible to have a JavaScript function that takes the results of a BROWSE control and opens that HTML file in a separate window of a specific Name (for example, Window_File)?
-
Re: Refreencing a local file
Thu, March 2, 2006 - 1:51 PMIve never put it to the test but i suppose it could. youd have to take the path returned from the browese command and parse it into a local url accoutning for differnt OS notations i would think, but i dont see why it wouldnt be possible... Course i dont have much experience with that type of thing either. Maybe some else will chime in and confirm or correct me... -
-
Re: Refreencing a local file
Thu, March 2, 2006 - 3:14 PMI think the file command returns a file name and a path and as long as you enter the path as the content for the new window, it ought to parse according to the OS.
Or, I might be remembering Matlab commands. 8/ -
-
Re: Refreencing a local file
Wed, March 8, 2006 - 2:40 PMMy goal here is to use JavaScript to allow you to do a bit of "file management" locally, as long as the files are only HTML files.
The browser would be the actual SAVE container, but the JavaScript could be modifying on-the-fly the window HTML content. -
-
Re: Referencing a local file
Thu, March 9, 2006 - 3:32 PMDo you mean local as in the web browser's local machine? That should never work, since it would open up a huge security hole in the user's machine that could be exploited by rogue websites. There used to be a bug in IE and Netscape that allowed Javascripts retrieved from the local cache to act on the local machine, but that exploit was squashed pretty quickly. -
-
Re: Referencing a local file
Fri, March 10, 2006 - 8:16 AMYeah.
Well, there IS a way to reference a local file, using the [ Browse... ] control, right?
Are you saying that after the [ Browse... ] control is used, the HTML file can't be opened in a window, or that the resultant window can't be referenced by a JavaScript? -
-
Re: Referencing a local file
Fri, March 10, 2006 - 9:24 AMOk jsut a question... Why the hell do you want to use JS for this? Why not use a text editor, or better yet something like Dreamweaver or GoLive for site management? Not to mention there are a number of tools that support scripting, and most of them can utilize vbscript, javascript, or applescript depending upon your platform. -
-
Re: Referencing a local file
Fri, March 10, 2006 - 9:58 AMFor the same reason I wrote an RGB graphics display function in JS. Because I thought it would be fun.
But really, there is an underlying thing here. I LIKE the idea of making a JS-based word processor. I like the idea of having an "app" on a server, and you click on the link and in a few seconds, your client machine is now running a word processor.
I realize that it's not a full-blown maxi-featured word processor.
I figured it would produce HTML files (just like any WP produces files in its own format).
But the idea stuck in my head.
The first real program I ever wrote was a word processor, so that's sorta' my personal windmill. -
-
Re: Referencing a local file
Fri, March 10, 2006 - 1:57 PMahhh i see.. theory paly haha. cool cool. i thought you were making something in an attempt to make things easier on yourself or fulfill a need, not necessairly proff of concept something.
Like i said if there is any answer for what you want to do i think its goign to have to be with xmlhttprequest. ITs the only thing that can open and modify file (other than a cookie) that i know of in JS. But even then your goign to be resticted to files that are on the machine serving the page. So youd ave to download the file when you were done or upload to edit soemthing. -
-
This is the maximum depth. Additional responses will not be threaded.
Re: Referencing a local file
Fri, March 10, 2006 - 2:02 PMMmmmmaybe.
I mean, there are a couple of things I'm thinking of. JS has no file capabilities, but BROWSERS do, so if I'm willing to let the browser to the file work, then that might release the JS to allow the editing.
Off the top of my head, the WP would offer you a browse button. Then, it opens a new window with that file. You work on it for a while. Then you save it using the browser save command.
It's a proof of concept, though. I like the idea of server-based apps that load into client memory. There's something about that odel that appeals to me.
-
-
-
-
-
-
-
-