[OSM-dev] need some javascript help

Iván Sánchez Ortega ivan at sanchezortega.es
Wed Feb 24 16:01:08 GMT 2010


El 24/02/2010 15:25, jamesmikedupont at googlemail.com escribió:
> Hi all, I am not a real javascript developer, can you give me some
> advice on this ;
[...]
> How can I connect two windows to each other, I would like to call a
> different url in what would its own sub window. so when you click on
> a text field, and right click on it, select find, it will then
> refresh the lower map window.

Sounds like you want to use iframes*. Simply put a <iframe 
id='foo'></iframe> somewhere, and that'll be your "sub-window". In order 
for it to load a URL, you just do 
document.getElementById('foo').src='url_goes_here'; in javascript.

* IFrames are evil. Yes, even more evil than FakeSteveC.

Another cleaner option is to use all that AJAX magic stuff to load the 
content in a <div> rather than in an <iframe>.

May I suggest you the "ajax for dummies" book? It's a nice hands-on 
introduction to this javascript stuff.


Cheers,
-- 
Iván Sánchez Ortega <ivan at sanchezortega.es>




More information about the dev mailing list