Connecting Tech Pros Worldwide Forums | Help | Site Map

Inject data into a iframe loaded page ?

Newbie
 
Join Date: Nov 2008
Posts: 3
#1: Nov 20 '08
Hi,

I am trying to do the following and would like to know if it's possible using Javascript/Ajax/and some DB

I have an Iframe hosted on one server that loads a page which is located on another server.

So mydomain.com is in the browser address bar and loads PageA (from Mydomain2.com). Page A contains a form and a submit button.

I need to Inject some data from the Db into one or several fields contained in the Form on PageA. And have an autoSubmit action done automatically .

Is it possible ? Without having to load a script or some element on mydomain2.com server where PageA is hosted. Or some code on PageA itself.

Thank you for your assistance

J

gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#2: Nov 20 '08

re: Inject data into a iframe loaded page ?


with javascript alone you cannot do any cross-site-scripting ... so: no you cannot do it ...

kind regards
Newbie
 
Join Date: Nov 2008
Posts: 3
#3: Nov 20 '08

re: Inject data into a iframe loaded page ?


Any other method It can be done AJAX, PHP, SOAP whatever is clever ?
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#4: Nov 20 '08

re: Inject data into a iframe loaded page ?


you could do a serverside http request to retrieve the page from the other domain serverside (use whatever you want) then 'copy' it and process/add anything you need and send it from 'your' domain ... now you have 'proxyed' this page and it is no cross-site-issue anymore ;) ... but you should check whether the provider of this page has anything against this behaviour unless you not provide this page for yourself ...

kind regards
Newbie
 
Join Date: Nov 2008
Posts: 3
#5: Nov 20 '08

re: Inject data into a iframe loaded page ?


Ok. With this method. If user 1 goes to mydomain.com and the script performs the action, the session info, IP etc.. submited will be from user 1 or would be the info of the server mydomain.com is hosted on. ?
gits's Avatar
Moderator
 
Join Date: May 2007
Location: Munich, Germany
Posts: 4,136
#6: Nov 20 '08

re: Inject data into a iframe loaded page ?


the 'other' page rely on session data? in this case i'm not sure whether your server (proxy) could handle this session data and how this could be done ... so i cannot help further in this case. but without a similar method (serverside proxy) you cannot add anything to the page in question ...

kind regards
Reply


Similar JavaScript / Ajax / DHTML bytes