I have all my javascript/jquery code in a file and include it into my page. Without having apache process js files as php what would be the best way to pass data from php to my js script? Right now I have a hidden div on my page that I echo out a value then using jquery I get the text content and then split it to get the variables. Is this a good way of doing it? Or is there a better way?
UPDATE
As mentioned prior, all my js code is in a .js file that I include into the webpage. The only way I could use php in this scenario is tell apache to treat .js files as php so it would recongize php code inside the .js file. I dont want to do this.
HTML
<div id="pagedata" style="display:none;">data1<>data2</div>
JS
var pagedata = $('#pagedata').text();
var break_data = pagedata.split('<>');