Forum Moderators: open

Message Too Old, No Replies

pass a variable from other domain page...

         

sugar2

5:43 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



few days ago i posted a topic of how to pass variables from other page (Same domain) with excellent responses from users... thanks!

Now the question is: what if i have my variable stored in other domain?

this is the phanorama:
In my first page i have a variable called "codeinv" and i need to know the inventory quantity of that SKU code (variable value).
Im my firs page i cannot execute php either asp, only HTML so i cannot do any database query, so I need to call a iframe from a php site (other domain) and that iframe pull the "codeinv" variable from it's calling page and do the query, then that page should return the value of "codeinv" lets say:
page 1: send this value to the php iframe "codeinv=040201-wh"
page 2: recive the variable, do a query and return this value to calling page "x=138"

everything works within the same domain my problem is that it DOESNT work if the calling page is stored in other domain: below are the source for the 2 pages:

Calling page: (www.MyDOmain.com/display.html)


<body onload="showVal()">
<style>iframe {display: none;}</style>
<script language="JavaScript">
function showVal() {
var X = frames["testFrame"].document.getElementById("X").value;
document.write(X); }
showVal(); </script>
<iframe src="http://site.My.Other.Domain.com/source.php?codeinv=040201-wh" id="testFrame" name="testFrame"></iframe>

php iframe: (site.My.Other.Domain.com/source.php)
NOTE: I Post only the ouput


<script>var X = 138;
function setVars() {
document.getElementById("X").value = X; }
document.write(window.url.code); </script>
<body onload="setVars()">
<input type="hidden" id="X" value="" />

any help will be apreciated
thanks!

ORBiTrus

6:23 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



[Edit: Deleted due to stupidity of comment]

Darn it, you replied to quick.

I said AJAX could work, but AJAX requires ActiveX in IE, which is a Bad Thing (tm).

[edited by: ORBiTrus at 6:34 pm (utc) on July 14, 2005]

sugar2

6:32 pm on Jul 14, 2005 (gmt 0)

10+ Year Member



thanks.. i will search it with google

thanks!