HighDots Forums  

Adding code to existing document (difficult question)

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Adding code to existing document (difficult question) in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Roee Bachar
 
Posts: n/a

Default Adding code to existing document (difficult question) - 10-25-2005 , 05:42 AM






I've site that is divided into two frames

Frame 1 Frame 2
???????????????????????
? ? ?
? ? ?
???????????????????????

At the first frame reside my site content.
At the second frame I'm hosting other (random) site from the net.

the question is:
How do I ** add ** code into the other site html document in order to add it
functionality that I need?

thanks
Roee



Reply With Quote
  #2  
Old   
Kimmo Laine
 
Posts: n/a

Default Re: Adding code to existing document (difficult question) - 10-25-2005 , 03:23 PM






"Roee Bachar" <mrroee (AT) netvision (DOT) net.il> kirjoitti
viestissä:djl258$2a5$1 (AT) news2 (DOT) netvision.net.il...
Quote:
I've site that is divided into two frames

Frame 1 Frame 2
???????????????????????
? ? ?
? ? ?
???????????????????????

At the first frame reside my site content.
At the second frame I'm hosting other (random) site from the net.

the question is:
How do I ** add ** code into the other site html document in order to add
it functionality that I need?

If you know what phishing is, you'll understand why it would be bad if you
could change the contents of a website that is not your own. It raises a
javascript security violation. You should read:
http://www.mozilla.org/projects/secu...me-origin.html which
explains the "same origin policy" thoroughly. Basiclly it checks that both
the documents are from same origin to allow them to interact. In your case
it would seem they are from different origin which totally ruins whatever
you were doing.

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Kimmo Laine <antaatulla.sikanautaa (AT) gmail (DOT) com.NOSPAM.invalid>




Reply With Quote
  #3  
Old   
Jasen Betts
 
Posts: n/a

Default Re: Adding code to existing document (difficult question) - 10-27-2005 , 03:44 AM



On 2005-10-25, Roee Bachar <mrroee (AT) netvision (DOT) net.il> wrote:

Quote:
I've site that is divided into two frames

At the first frame reside my site content.
At the second frame I'm hosting other (random) site from the net.

the question is:
How do I ** add ** code into the other site html document in order to add it
functionality that I need?
You can't. the site that supplies the frame content must do that.



Hmmm, possibly you could use XmlHttpRequest to download the page
and frame[2].document.write to insert it into the frame....

Then your javascript would be supplying the content so it would
'own' the page...

Bye.
Jasen


Reply With Quote
  #4  
Old   
Roee Bachar
 
Posts: n/a

Default Re: Adding code to existing document (difficult question) - 10-28-2005 , 08:35 AM



I love your idea. I'll give it a try.
Thanks a lot,
Roee



"Jasen Betts" <jasen-b (AT) free (DOT) net.nospam.nz> wrote

Quote:
On 2005-10-25, Roee Bachar <mrroee (AT) netvision (DOT) net.il> wrote:

I've site that is divided into two frames

At the first frame reside my site content.
At the second frame I'm hosting other (random) site from the net.

the question is:
How do I ** add ** code into the other site html document in order to add
it
functionality that I need?

You can't. the site that supplies the frame content must do that.



Hmmm, possibly you could use XmlHttpRequest to download the page
and frame[2].document.write to insert it into the frame....

Then your javascript would be supplying the content so it would
'own' the page...

Bye.
Jasen



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.