Closed Thread Icon

Topic awaiting preservation: Fetching source in another frame. (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=23045" title="Pages that link to Topic awaiting preservation: Fetching source in another frame. (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Fetching source in another frame. <span class="small">(Page 1 of 1)</span>\

 
zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 08-24-2004 13:50

Ok, I have a page with some frames, I want to have one of the frames which contains a form, fetch the source in another frame and put it in a text field and then submit the form. I want this all to happen when the frame with source loads.

Any help? Can it even be done?
It's been a long time since I used JavaScript for its good uses.

[Edit: I noticed I misspelled "Fetching" in the title.]
[Edit: I also know I misspelled "source" in the title also... Man, I'm doing bad today.]



(Edited by zavaboy on 08-24-2004 14:52)

(Edited by zavaboy on 08-24-2004 14:55)

BillyRayPreachersSon
Nervous Wreck (II) Inmate

From: London
Insane since: Jul 2004

posted posted 08-24-2004 16:40

Do you want to fetch the COMPLETE source - head, body, everything? Or just the contents of the body tag?

Does the code you have need to be exactly as-is, or can things be "re-arranged" (for example, head followed by body)?

If you need an exact, as-is copy, I don't believe you will be able to do this easily with JS, and counter every circumstance of people putting code outside head and body sections, comments in code, etc... Although I could easily be wrong on this.

Dan

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 08-25-2004 07:48

I need everything, but a least contents of the <title> and contents of the <body>.

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 08-27-2004 17:29

Basicly...
How do I fetch the title and body of Google?
If I can do that, I can do what I need it to do.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 08-27-2004 20:06

You can't actually

When accessing frames or child pages, you are only allowed access to pages within the same domain for security reasons.



.:[ Never resist a perfect moment ]:.

Iron Wallaby
Paranoid (IV) Inmate

From: USA
Insane since: May 2004

posted posted 08-27-2004 20:37

Are you sure this is a job for Javascript?

Perhaps it could better be done with PHP or Perl.

"Any sufficiently advanced technology is indistinguishable from magic." -- Arthur C. Clarke
"Any sufficiently arcane magic is indistinguishable from technology." -- P. David Lebling

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 08-27-2004 22:41

Using Javascript was just another one of my bad/worthless ideas...
I found out how it could be done with PHP. I have tested it and got exatly what I wanted.
In any case, thanks for the halp!

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 08-27-2004 23:39

I come a little late, but if your target audience has a modern browser, you can certainly solve your problem via the XMLHttpRequest object. I haven't really played with it yet, but from what I've read so far it seems that it's also possible to fool the server-side script processing the form fields to believe that the datas comes from the initial page.

Scott
Bipolar (III) Inmate

From: schillmania.com
Insane since: Jul 2002

posted posted 08-28-2004 19:50

I agree with poi - XMLHTTP is a great way to go, at least where supported. (Mozilla 1.x+ I think, Safari 1.2 and IE 5+. Opera's out.)

related XMLHTTP tutorial.

MajorFracas
Nervous Wreck (II) Inmate

From:
Insane since: Jul 2003

posted posted 08-30-2004 16:38

There are cross-site security restrictions on XMLHttpRequest as well, at least by default in Mozilla. For Mozilla, your script will have to explicitly invoke one or more security permissions as in the following example:

code:
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");


This will cause dialog(s) to prompt the user for permission to grant the privilege.
In addition, the script will either have to be signed or the signed.applets.codebase_principal_support configuration attribute must be enabled in the browser.

I can't speak to how IE handles this (or doesn't).

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 08-31-2004 16:18

Actuly this might be what I'm looking for... I found out I couldn't use PHP for what I needed it for because I'll be violating some rules. Thanks!

MajorFracas
Nervous Wreck (II) Inmate

From:
Insane since: Jul 2003

posted posted 08-31-2004 18:19

Just promise us this won't be used for nefarious purposes.

zavaboy
Bipolar (III) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 08-31-2004 19:09

Don't worry, I wont... I just want a faster and easier way of getting something done.

« BackwardsOnwards »

Show Forum Drop Down Menu