# Script execution "Top of pages" vs "HTML Head" - Regression?

**URL:** https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900
**Category:** Feature
**Created:** [12 Gennaio 2015, 12:32am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900 "2015-01-12T00:32:21Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [12 Gennaio 2015, 12:32am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/1 "2015-01-12T00:32:21Z")

</div>

I used to have some script in the “Top of pages” section…

However recently I noticed it’s no longer getting executed.

I rewrote the JavaScript so it could work in “HTML Head” where it does get executed.

 ![](https://global.discourse-cdn.com/meta/original/3X/2/4/2473b741734b260b7bc4885d6ee7d817216c49a5.png) 

The `4` is where I was putting the JavaScript `script` tags previously.

---

<div class="post-metadata">

### Author: ![Huey\_Le](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/huey_le/32/63362_2.png) [@Huey\_Le](https://meta.discourse.org/u/Huey_Le)
#### Post date: [12 Gennaio 2015, 1:00am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/2 "2015-01-12T01:00:17Z")

</div>

You need to go to CSS/HTML TAB

From there, go to HEADER section and paste your Script there

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [12 Gennaio 2015, 1:06am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/3 "2015-01-12T01:06:15Z")

</div>

Not a regression, we had like 3 different areas in Admin where you could put “stuff at top of page” and we normalized to only one.

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [12 Gennaio 2015, 2:28am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/6 "2015-01-12T02:28:00Z")

</div>

So to be clear you just stopped the JavaScript in the `Top of pages` section from executing?

I ask because I can still put normal HTML content in `Top of pages` which is what I need - it’s in the wrong place anywhere else.

@zogstrip any ideas?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [12 Gennaio 2015, 7:24pm UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/7 "2015-01-12T19:24:48Z")

</div>

All three `Top of the pages`, `Bottom of the pages` and `HTML Head` contents were created **before** we had a solid site customization story. Now that we do, I migrated them under the proper `CSS/HTML` tab and used `SiteCustomization` instead of the `SiteText`.

This should have been pushed last week, but for some reason wasn’t 😊 I renamed the migrations and properly (_this time_) pushed it 🐀

[https://github.com/discourse/discourse/commit/6ee2849df64e048bce387a4a289d16c7276e770f](https://github.com/discourse/discourse/commit/6ee2849df64e048bce387a4a289d16c7276e770f)

**NOTES**

- `HTML head` was migrated into `</head>`
- `Bottom of the pages` was migrated into `</body>`
- `Top of the pages` was removed as it’s redundant (should either use header or the `Global Notice`).

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [13 Gennaio 2015, 1:35am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/8 "2015-01-13T01:35:16Z")

</div>

@zogstrip  
After updating to the current version my ads disappeared.

Previously I used `Top of the pages` to insert simple HTML ad content.  
`Global Notice` is inappropriate for this - forces the single line of text in s notice styled box.  
This is also the type of content that is independent of `theme` or `style` where `Text Content` made sense.

Currently I don’t have any obvious way to add my ads back in where I had them.

I’m assuming there is some complex template I can modify - but this seems a bit much for a simple image ad banner.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [13 Gennaio 2015, 1:48am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/9 "2015-01-13T01:48:38Z")

</div>

A small (but as it turns out important) change in this commit broke some things and unfortunately had to be reverted. The migration was not destructive so if you get master now you should see your ad again. Tomorrow @zogstrip will fix it and un-revert 😄

---

<div class="post-metadata">

### Author: ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)
#### Post date: [13 Gennaio 2015, 1:53am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/10 "2015-01-13T01:53:28Z")

</div>

Thanks @eviltrout - thought I was going to have to re-write the HTML to insert via JavaScript at almost 2am then 😄

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [14 Gennaio 2015, 11:19am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/11 "2015-01-14T11:19:36Z")

</div>

Here’s the commit that move all 3 `SiteText` fields to `SiteCustomization` 🪲

[https://github.com/discourse/discourse/commit/6734a51b6add70d576f25b29afbebc85f79bdc2f](https://github.com/discourse/discourse/commit/6734a51b6add70d576f25b29afbebc85f79bdc2f)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [15 Gennaio 2015, 11:23am UTC](https://meta.discourse.org/t/script-execution-top-of-pages-vs-html-head-regression/23900/12 "2015-01-15T11:23:18Z")

</div>

This topic was automatically closed after 24 hours. New replies are no longer allowed.
