# Adding a code with .js file to wix website

**URL:** <https://forum.wixstudio.com/t/adding-a-code-with-js-file-to-wix-website/69726>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [March 19, 2025, 8:05pm UTC](https://forum.wixstudio.com/t/adding-a-code-with-js-file-to-wix-website/69726 "2025-03-19T20:05:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![CODE-NINJA](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/code-ninja/32/110588_2.png) [@CODE-NINJA](https://forum.wixstudio.com/u/CODE-NINJA)\
**Post date:** [September 16, 2025, 4:53pm UTC](https://forum.wixstudio.com/t/adding-a-code-with-js-file-to-wix-website/69726/4 "2025-09-16T16:53:41Z")

</div>

You maybe should read that one …

> [@Integration of external scripts with fixed container IDs in Wix Live](https://forum.wixstudio.com/t/integration-of-external-scripts-with-fixed-container-ids-in-wix-live/73402/12):
>
> Problem already solved ? By the way → you got an e-mail.

If you do not want to use an iFrame, you still have the option to use a CUSTOM-ELEMENT.  
If you do not want to use a custom element and you want to work directly on your page, you still have the option to use CUSTOM-CODE inside of the DASHBOARD-SETTINGS.

And if you don’t want to use any of those 3-possible solutions, you still can do by using the HTTP-FUNCTIONS.JS + YOUR OWN GENERATED SERVER → POLLING-SOLUTION.

**How does it work?**

1. You generate a smal server (running local on your own machine)
2. You expose some of Wix-HTTP-Functions
3. Your generted SERVER → will poll data peridiocally (let’s say every 5 seconds).
4. If data changes on wix site → your server recognizes this changes → now your server can react and can do what ever you want!!!

a) starting a function on your server  
b) sending back some data to Wix  
c) Starting a HTTP-FUNCTION on Wix side.  
d) …or doing what ever you want.

And by the way —\> Wix do not like push-messages (pushing data to Wix server) for example SSE —\>

When working with **Server-Sent Events (SSE)**, the **push mode process** that sends data to clients is typically referred to as **“emitting events”** or **“streaming events”**. In SSE terminology, the server **pushes messages** to the client over an open HTTP connection using a specific format.

## **Push vs Polling in Context**

- **SSE Push Mode**
  - The server _automatically sends updates_ to the client without being asked each time.
  - Example: A live stock ticker or chat messages being streamed.

- **Polling**
  - The client must _repeatedly ask the server_:

> “Do you have new data now? How about now? … now?”

- Example: Refreshing a notifications count every 5 seconds.

I tried the PUSH-MODE several times, and Wix do not like **SSE-MODE**!!!

---

_[View the full topic](https://forum.wixstudio.com/t/adding-a-code-with-js-file-to-wix-website/69726)._
