0

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?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

this may be helpful as well: stackoverflow.com/questions/950087/…
can I use wp_enqueue_script() within the html in the online interface for editing a wordpress page?
As long as you can edit PHP code there I don't see why not. I never used the online interface.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.