/    Sign up×
Community /Pin to ProfileBookmark

communication between pages

How can I have the following:

There are 2 pages. When a user clicks SAVE button on first page it brings up second page and changes some attributes on that (second) page. How can I do that?

Thanks, javaScripters.

?

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@hansiddJun 30.2005 — éok
Copy linkTweet thisAlerts:
@ck_net_2004Jun 30.2005 — You could pass a variable from one page to another through the URL.

for example:

on page one:
[code=php]
function pass_a_var(){
var a="dothis"
window.location.href='page2.htm?passvar='+a+';';
}
[/code]

on page 2:
[code=php]
function get_a_var(){
var a = window.location.toString();
if(a.indexOf("?")>=0){
var a=a.substring(a.indexOf("=") + 1, a.indexOf(";"));
alert(a);
}
}
[/code]
Copy linkTweet thisAlerts:
@thisObjectauthorJul 01.2005 — Cool but this is not what I want ?

I have a frameset. Frame one has name XYZ

I want to pass that name to Frame two. How would I do that?

thanks!
Copy linkTweet thisAlerts:
@BigMoosieJul 01.2005 — I think you already have the solution above ^
Copy linkTweet thisAlerts:
@ck_net_2004Jul 01.2005 — thisObject, Post the code for both of your pages.
Copy linkTweet thisAlerts:
@BigMoosieJul 01.2005 — Oh I reread your post.

top.frames["frameName"].variableName=data;
Copy linkTweet thisAlerts:
@thisObjectauthorJul 05.2005 — what does this return? top.frames["frameName"]. Does it return a page? So if I have an html or xml page it just returns it and then I can do someting like:

top.frames["top_frame"].getElementByName("custom")

???
×

Success!

Help @thisObject 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,
)...