Title: Javascript Source File independent pages include?
Last modified: July 28, 2024

---

# Javascript Source File independent pages include?

 *  [CheriOR](https://wordpress.org/support/users/cherior/)
 * (@cherior)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/javascript-source-file-independent-pages-include/)
 * I have a couple of javascript source files that I would like to limit to include
   only on specific website pages. If I enable them in Code Manaager, they are included
   on all pages, and one of them is necessary on one page of the site, but breaks
   the functionality of another page.
 * Nothing comes to mind, without poring through both scripts to find the conflict–
   would be simpler to just not include the one resource file on the conflicting
   page… thoughts?
   I really am having fun with code manager, though. I can do all
   sorts of things I ‘want to do’ – like adding javascript and html within a PHP
   shortcode, just by using the “echo” command. And I don’t have to learn all the
   structure of WordPress to do it!!
 * Thank you for this!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * (@peterschulznl)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/javascript-source-file-independent-pages-include/#post-17921900)
 * Hi [@cherior](https://wordpress.org/support/users/cherior/)
 * Thank you for reaching out.
 * Here are three suggestions which I hope might help:
 * (1) It is not possible to limit javascript source files to specific pages, but
   if you need them on the front-end only, you can use a javascript shortcode instead
   of a javascript resource file. Would that work for you?
 * (2) Alternatively, you can use php server code which allows you to check for 
   specific pages. Not my preferred solutions but a possibility.
 * (3) Generally it’s a good idea to add only javascript functions to a resource
   file. If you have two different resource files, you can give your functions different
   names to prevent conflicts. Would that help to solve the conflict?
 * Thanks
   Peter

Viewing 1 replies (of 1 total)

The topic ‘Javascript Source File independent pages include?’ is closed to new replies.

 * ![](https://ps.w.org/code-manager/assets/icon-128x128.png?rev=2392773)
 * [Code Manager](https://wordpress.org/plugins/code-manager/)
 * [Support Threads](https://wordpress.org/support/plugin/code-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/code-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-manager/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Passionate Programmer Peter](https://wordpress.org/support/users/peterschulznl/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/javascript-source-file-independent-pages-include/#post-17921900)
 * Status: not resolved