---
title: "How to insert JavaScript into a PHP-Fusion article"
description: "In this article I'm going to discuss the process of adding a bit of JavaScript code into a PHP-Fusion article. This process is going to take advantage of the built-in add_to_head output handling..."
url: https://www.inmotionhosting.com/support/edu/php-fusion/how-to-insert-javascript-into-a-php-fusion-article/
date: 2013-03-25
modified: 2022-03-11
author: "InMotion Hosting Contributor"
categories: ["PHP-Fusion"]
type: post
lang: en
---

# How to insert JavaScript into a PHP-Fusion article

In this article I’m going to discuss the process of adding a bit of JavaScript code into a PHP-Fusion article.

This process is going to take advantage of the built-in **add_to_head** output handling function that is available in PHP-Fusion. There are also other output handling functions like **add_to_footer** and **add_to_meta** that allow you to perform similar actions on your content. You can see the full list of PHP-Fusion functions like this that are built-in on the [PHP-Fusion 8 Development & Project site](https://www.8.php-fusion.net/infusions/fusion_functions/functions.php?category=output-handling).

## Adding JavaScript to a PHP-Fusion article

Using the steps below, I’ll walk you through the process of getting a simple JavaScript alert pop-up to function within one of your PHP-Fusion articles.

1. [Login to the PHP-Fusion admin panel](/support/edu/php-fusion/login-admin-panel/).
2. [![click on articles](https://www.inmotionhosting.com/support/wp-content/uploads/2013/03/edu_php-fusion_add-javascript_click-on-articles.png)](/support/wp-content/uploads/2013/03/edu_php-fusion_add-javascript_click-on-articles.png) Click on **Articles**.
3. [![type in article content click on save article](https://www.inmotionhosting.com/support/wp-content/uploads/2013/03/edu_php-fusion_add-javascript_type-in-article-content-click-on-save-article.png)](/support/wp-content/uploads/2013/03/edu_php-fusion_add-javascript_type-in-article-content-click-on-save-article.png) I have gone ahead and filled in the **Subject**, **Snippet**, and the **Article** content with the following text:

You should now know how you can get JavaScript code successfully added to one of your PHP-Fusion articles.
