Title: Include javascript file with extension php and using _e
Last modified: August 19, 2016

---

# Include javascript file with extension php and using _e

 *  [ctomczyk](https://wordpress.org/support/users/ctomczyk/)
 * (@ctomczyk)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/include-javascript-file-with-extension-php-and-using-_e/)
 * Hi,
 * I want to include JavaScript file using:
 * <script type=”text/javascript” src=”file.js.php”></script>
 * In this “file.js.php” I want to use _e function, but this doesn’t work.
    What
   do I have to do more to function _e I work in a given file?
 * —
    CT

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [gwozdzmateusz](https://wordpress.org/support/users/gwozdzmateusz/)
 * (@gwozdzmateusz)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/include-javascript-file-with-extension-php-and-using-_e/#post-1238334)
 * Hi!
 * So, if u want to attach .js file, all U need to do, is use
    `<?php include("file.
   php"); ?>` In this file start with `<script type="text/javascript">` and close
   the tag after Your javascript.
 * Powodzenia 😉
 *  Thread Starter [ctomczyk](https://wordpress.org/support/users/ctomczyk/)
 * (@ctomczyk)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/include-javascript-file-with-extension-php-and-using-_e/#post-1238335)
 * No, I don’t ask how to load JavaScript file with php extension. All I had to 
   do is:
 * define(‘ABSPATH’, ‘abs path to Your wp install’);
    require_once(ABSPATH.’wp-config.
   php’); require_once(ABSPATH.’url to Your JavaScript file’);
 * And then You may use _e function.
 * Regards,
    CT

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Include javascript file with extension php and using _e’ is closed to
new replies.

## Tags

 * [js](https://wordpress.org/support/topic-tag/js/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [_e](https://wordpress.org/support/topic-tag/_e/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [ctomczyk](https://wordpress.org/support/users/ctomczyk/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/include-javascript-file-with-extension-php-and-using-_e/#post-1238335)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
