I am wondering what the most efficient method is to add a javascript file specifically for a post and/or page.
Here are a few solutions I came up with:
- Switch to HTML editing view and post your JavaScript in there (pretty bad solution)
- Custom fields with the specific JavaScript for that post/page in the key & value pairs
- In footer.php, load JavaScript files depending on which page you're on (this leads to a lot of conditionals though)
On a side note, none of the JavaScript files will be shared between pages - it will literally be specific to what you're currently viewing.
Any thoughts?