I am writing an interactive google map in javascript for a wordpress page. As far as I know, the only way to use javascript with wordpress is by creating a separate .js file and just calling the methods from there within the wordpress page. So my question is, if I need to use the google maps api in my javascript code, how do I 'include' it within the .js file instead of using a <script> tag in the html?
Add a comment
|
1 Answer
AFAIK there is no include in javascript. Take a look at wp_enqueue_script().
Edit
Just stumbled over the yepnope.js library by Alex Sexton. Maybe this is what you are looking for.
3 Comments
Gerald Schneider
this may be helpful as well: stackoverflow.com/questions/950087/…
azrosen92
can I use
wp_enqueue_script() within the html in the online interface for editing a wordpress page?Gerald Schneider
As long as you can edit PHP code there I don't see why not. I never used the online interface.