So I’ve got some scripts I’ve written which set up a Google map on my page. These scripts are in included in the <head> of my page, and use jQuery to build the map with markers generated from a list of addresses on the page.
However, I have some exact co-ordinate data for each address which the javascript requires to place the markers correctly. This isn’t information I want to be visible on the screen to the user, so what’s the ‘best practice’ way to put that data into my document?
I would not reccomend using style to hide something, it will show up in browsers without (or with disabled) css suppor and look strange.
You could store it in a javascript variable or add a form with hidden values like this (inside an unused form to be sure it validates):
wich you can read and update from javascript.