•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 455,964 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,609 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 2149 | Replies: 13
![]() |
•
•
Join Date: Sep 2007
Posts: 81
Reputation:
Rep Power: 2
Solved Threads: 1
my application makes extensive use of the Google map and I would like to know how I can pass latitude and longitude information obtain from one page to the next. the function I like to access exist in a completely different web page located on our server.
The problem seems very straight forward but I don't know how to accomplish the task. However, I would appreciate anyone who can point me in the right direction.
The problem seems very straight forward but I don't know how to accomplish the task. However, I would appreciate anyone who can point me in the right direction.
Re: Would like to pass two parameters to a function that is outside of a web page.
#2
Nov 21st, 2007
1. open your new page window (make sure you save the window to a variable i.e. 'win')
2. from existing page check the new window youve opened to see if it is finished loading. If it has then call the function if not set timeout to try again
var win = window.open(....);
checkwin(){
if(win.document.readyState == 'complete') {
win.functionname(variable1, variable2);
} else {
settimeout('checkwin()', 1000);
}
}
checkwin(); When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
•
•
Join Date: Sep 2007
Posts: 81
Reputation:
Rep Power: 2
Solved Threads: 1
Re: Would like to pass two parameters to a function that is outside of a web page.
#3
Nov 21st, 2007
Re: Would like to pass two parameters to a function that is outside of a web page.
#4
Nov 21st, 2007
the implementation i stated opens a popup and passes 2 values throught to a function located on that page. are you doing the opposite and trying to obtain two values from the parent of the current window ?
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
•
•
Join Date: Sep 2007
Posts: 81
Reputation:
Rep Power: 2
Solved Threads: 1
Re: Would like to pass two parameters to a function that is outside of a web page.
#5
Nov 21st, 2007
Re: Would like to pass two parameters to a function that is outside of a web page.
#6
Nov 21st, 2007
Is the event which initiates the sending of information from one page to another user initiated? Do you want this to be done server side or client side?
If you want to do it server side, just set those values in hidden fields, extract those using the server side language of your choice and send the response page to the client with the given values set (here I am talking about J2EE servets). If you want to do it using Javascript, just set the
Encode values if needed.
If you want to do it server side, just set those values in hidden fields, extract those using the server side language of your choice and send the response page to the client with the given values set (here I am talking about J2EE servets). If you want to do it using Javascript, just set the
href property of the location object.location.href = 'http://www.google.com?var1=' + var1 + '&var2=' + var2;
Encode values if needed.
Last edited by ~s.o.s~ : Nov 21st, 2007 at 1:08 pm.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
•
•
Join Date: Sep 2007
Posts: 81
Reputation:
Rep Power: 2
Solved Threads: 1
Re: Would like to pass two parameters to a function that is outside of a web page.
#7
Nov 21st, 2007
Yes. the event is user initiated. I figured when the user initiated the event, I can pass the lat and long value to the next page while loading and accessing the event.addlistener method of that page. what I would like to see happened is to have pass the arguments from the previous page to the next page and have the info window opened once its fully loaded (pretty much your first assumption).
I think the query string location.href.... would work well, however I don't see how I can automatically call the event.addlistener from that point.
I think the query string location.href.... would work well, however I don't see how I can automatically call the event.addlistener from that point.
•
•
Join Date: Sep 2007
Posts: 81
Reputation:
Rep Power: 2
Solved Threads: 1
Re: Would like to pass two parameters to a function that is outside of a web page.
#8
Nov 21st, 2007
Re: Would like to pass two parameters to a function that is outside of a web page.
#9
Nov 21st, 2007
i agree with SOS that if you wish to do this without opening a popup then simply append your values to the path of the page calling then add an onload event to that page that checks to see if these variables are set. If so then fire away on whatever you wish to do with this info.
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
•
•
Join Date: Sep 2007
Posts: 81
Reputation:
Rep Power: 2
Solved Threads: 1
Re: Would like to pass two parameters to a function that is outside of a web page.
#10
Nov 21st, 2007
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
adult advertising ajax asp blog browser browsing community data design developer development devices domains firefox google html india intel internet java legal linux marketing microsoft mozilla msdn msn multimedia news php privacy report research rss search security software sql sun video vista w3c web web development wiki xml yahoo youtube
- Keyword search in a web page (Java)
- print web page (JavaScript / DHTML / AJAX)
- Downloading web page source. (C)
- Pass parameters between Javascript and ASP (JavaScript / DHTML / AJAX)
- displaying data onto a web page (ASP.NET)
- Change Web Page Font Size on the Fly (Windows tips 'n' tweaks)
- How to create a web page with scrolling menus to specific entries (HTML and CSS)
- unable to access my web page (Domains and DNS)
- Win XP Explorer - Web Page View (Windows NT / 2000 / XP / 2003)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: change window attributes in body onload..
- Next Thread: load an xml file,to treeview control throw dhtml



Linear Mode