1

I have a javascript file that has the variable named locations, with some data in quotes for example, 'name', '123 lane', and etc. I want the variable to get data from a database and not the plain text. How do I insert the code to do this into my JavaScript variable? I'm new to this, Thanks!!

closed as off-topic by closetnoc, dan Apr 8 '15 at 4:00

  • This question does not appear to be about webmastering within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • You might want to start here: w3schools.com/js/default.asp – closetnoc Apr 8 '15 at 2:40
  • 1
    Unfortunately questions about coding are considered off-topic here. You might ask this over at Stack Overflow, but be sure to include enough details and any code you've tried, as they generally like to see some attempt at coding first. – dan Apr 8 '15 at 4:00
1

It seams like the best way to go about it, is to have a php file which returns the output of your data set; and just make a ajax call to it. Maybe these resources will help:

Not the answer you're looking for? Browse other questions tagged or ask your own question.