Passing information / strings between methods

C

ChrisW

Hi,

Apologies if this is the wrong place to post this.

I've got a small site - http://www.srcf.ucam.org/~ccw34/ostests/index.php
- where I've got an OS Map (using the Openspace API -
http://openspace.ordnancesurvey.co.uk/openspace/index.html). I can
use HTML links to navigate to places on the map, and open information
windows. I can then use jQuery to open a popup window (which is
essentially a hidden div), via the HTML links on the information
window.

However, I want the content of this popup box to reflect the current
location (at the moment, this information is jsut stored as variables
on that page, but I plan to write a JSON file for all the data) . At
the moment, when I click the HTML link on the information window on
the map, I use onclick="openPopup()", which then loads the popup using
loadPopup(). I was hoping to run a function (writeContent(placeName))
within loadPopup() method to write the content in the div, but this
doesn't work.

Essentially, I've got no problem in getting the name of the current
place during the loadPopup() method, just passing this information to
the div before it loads. (At the moment, I've got all my tests
commented out, and the popup loads when the links on the information
window is clicked - if any of my test functions are uncommented, the
popup stops working totally, and just doesn't load).

I hope my problem makes sense - if anyone can give any help, I'd be
most grateful.

Thanks,
Chris
 
C

CCW

Hi,

Apologies if this is the wrong place to post this.

I've got a small site -http://www.srcf.ucam.org/~ccw34/ostests/index.php
- where I've got an OS Map (using the Openspace API -http://openspace.ordnancesurvey.co.uk/openspace/index.html).  I can
use HTML links to navigate to places on the map, and open information
windows. I can then use jQuery to open a popup window (which is
essentially a hidden div), via the HTML links on the information
window.

However, I want the content of this popup box to reflect the current
location (at the moment, this information is jsut stored as variables
on that page, but I plan to write a JSON file for all the data) .  At
the moment, when I click the HTML link on the information window on
the map, I use onclick="openPopup()", which then loads the popup using
loadPopup().  I was hoping to run a function (writeContent(placeName))
within loadPopup() method to write the content in the div, but this
doesn't work.

Essentially, I've got no problem in getting the name of the current
place during the loadPopup() method, just passing this information to
the div before it loads.  (At the moment, I've got all my tests
commented out, and the popup loads when the links on the information
window is clicked - if any of my test functions are uncommented, the
popup stops working totally, and just doesn't load).

I hope my problem makes sense - if anyone can give any help, I'd be
most grateful.

Thanks,
Chris

This was a lot easier than I thought it would be, I can just
use .innerHTML on the div from the loadPopup() function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top