/    Sign up×
Community /Pin to ProfileBookmark

Passing variable between servers

Hello,

I have a bit o a problem, maybe the forum can help me.

I have 2 servers, on the first server there is a page that as a form with a text box. In front of it i have a button that opens a popup window. This windows is located in another server, server 2. In this window I select a value in a listbox and on submit I do a “opener.form.listbox.value = …”

I know that if this were in the same server it would run nicely. The problem is that this is in two diferent servers. My question is that if it is possibel to do it.

PS. At this time it throws an “Access denied error”

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterApr 28.2005 — Hmm....

You can pass an argument from the pop-up to a function in the opener.

example:
<i>
</i>opener.someFunction(myVariableFromThePopUp)
Copy linkTweet thisAlerts:
@phpnoviceApr 28.2005 — No, cross-domain scripting is verboten in the Internet environment. What would have to be done is to submit the value back to the other domain. This can be accomplished by having the main window name itself:
[code=html]
<body onload="top.name='mainWindow'; return true;">
[/code]

Then the popup window would have a FORM tag coded as follows:
[code=html]
<form action="http://otherdomain.com/page.asp" target="mainWindow">
[/code]
Copy linkTweet thisAlerts:
@phpnoviceApr 28.2005 — Hmm....

You can pass an argument from the pop-up to a function in the opener.

example:
<i>
</i>opener.someFunction(myVariableFromThePopUp)
[/QUOTE]

I don't think you've tried that. ?

It doesn't work cross-domain.
Copy linkTweet thisAlerts:
@UltimaterApr 28.2005 — I've done it with bookmarks before but instead it was:

javascript:void(opener.someFunction(myVariableFromThePopUp))
Copy linkTweet thisAlerts:
@phpnoviceApr 28.2005 — Bookmarks don't count. They don't actually execute between domains.
Copy linkTweet thisAlerts:
@UltimaterApr 28.2005 — hmm... I don't have two seperate domains to test it but I'll take your word for it.
Copy linkTweet thisAlerts:
@phpnoviceApr 28.2005 — I know that if this were in the same server it would run nicely. The problem is that this is in two diferent servers. My question is that if it is possibel to do it.

PS. At this time it throws an "Access denied error"[/QUOTE]

So, this post represents your best solution -- I think:

http://www.webdeveloper.com/forum/showpost.php?p=359605&postcount=3
Copy linkTweet thisAlerts:
@azazel_26authorMay 04.2005 — Thank you very much
Copy linkTweet thisAlerts:
@phpnoviceMay 04.2005 — Cheers.
×

Success!

Help @azazel_26 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...