I wrote:
> Javilk wrote:
>
> What I want is:
>
> >     1. Annotation saved to MY site, yet linked to the pages I have
> > visited.
>
> Off the top of my head, would it be possible to put something
> together using
> javascript, like this:
>
> * 2 frames
> * top frame holds the site being viewed
> * bottom frame holds a form, served from your server, where you can write
> notes
> * javascript is used to load the url of the top form into a
> hidden variable
> in the bottom form everytime the top frame is changed
> * bottom form has a submit button that allows you to save your note, along
> with the url that it relates to
> * setup another couple of pages on your server to review your
> notes, go back
> to the original link, etc.

After a bit of research, this does not appear to be possible with
JavaScript, due to the following JavaScript security measure:

"Navigator version 2.02 and later automatically prevents scripts on one
server from accessing properties of documents on a different server. This
restriction prevents scripts from fetching private information such as
directory structures or user session history."

There's more about this under "Data tainting" in the javascript docs. You
need the cooperation of the other site owner to get any javascript info from
their site, even something like the url.

This translates to the fact that a javascript functioning in one window on
one server cannot access the properties of a window that is filled with a
page from another server. My logic was:

1. Setup a frameset with 2 frames, the top one containing sites being
surfed, the bottom one containing a note form running on my server.
2. Use: parent.site.window.location.href to get the url of the page loaded
in frame one
3. write the url of frame one into a hidden variable on frame two every time
it changes.
4. jot down a note in frame two and save it to my server when I want to,
along with the url acquired in step 2 above.

Turns out, from what I can tell, that you can't access the url for frame one
from frame 2 (nor the "top" frame) if the site in frame one is on another
server. Therefore you can't write the url of frame one to a variable and
save it with the note. The browser generates a "permission denied" error.

Fooey! Can anyone think of a hack to get around this?

Thanks,
Jack

____________________________________________________________________
--------------------------------------------------------------------
 Join The Web Consultants Association :  Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------

Reply via email to