If this is your first visit, check our documentation. To post, register or login.

Custom javascript per page

Started by bobmeetin on 19 Apr 2013, 4:09 PM · Views: 861

Results 1 to 2 of 2
19 Apr 2013, 4:09 PM
#1
bobmeetin avatar

bobmeetin

New Zenner

Join Date:
Jan 2006
Posts:
57
Plugin Contributions:
0

Post #1 by bobmeetin

What is the best way to adding custom javascript per page, EZpages? I know that you can include it in the page, but I would rather call it externally if a specific page is loaded.

19 Apr 2013, 6:55 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2 by gjh42

I might try page-specific js loading with a jscript_whatever.php file in /includes/modules/pages/page/. In that file would be PHP logic to look up the current ez-page id, and load the desired script accordingly.

Look at /includes/templates/template_default/common/html_header.php for examples of how that loads js files.