Best way to include unobtrusive information on a web page

前端 未结 7 1090
栀梦
栀梦 2021-02-06 16:34

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 of my page, and use jQuery to build

7条回答
  •  春和景丽
    2021-02-06 17:19

    My first thought was a hidden input with a CSV or similar of the data. Since the data is not really secret, just not for display.

     
    

    Then access it with jquery

     var myCoordsCSV = $("#coordinates").val();
    

    Edit: A below answer mentions JSON which would be a better solution combined with using multiple hidden inputs as pointed out in another answer.

提交回复
热议问题