# JavaScript in post?

**URL:** <https://discuss.write.as/t/javascript-in-post/446>\
**Category:** Customization\
**Created:** [March 6, 2019, 5:31pm UTC](https://discuss.write.as/t/javascript-in-post/446 "2019-03-06T17:31:44Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bugbuster](https://discuss.write.as/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@bugbuster](https://discuss.write.as/u/bugbuster)\
**Post date:** [March 6, 2019, 6:58pm UTC](https://discuss.write.as/t/javascript-in-post/446/2 "2019-03-06T18:58:38Z")

</div>

Matt has commented on how custom javascript can be applied to a specific web page here. Click on the down arrow or the link itself to expand his comment into a more readable format with line breaks.

> [@Line width of text in posts - how to increase it to take advantage of monitor resolution](https://discuss.write.as/t/line-width-of-text-in-posts-how-to-increase-it-to-take-advantage-of-monitor-resolution/92/4):
>
> Yep, both the CSS and JS is included on every blog page. (The only caveat with the JS is that your Preferred URL in your blog settings has to be [yourblog.writeas.com](http://yourblog.writeas.com) or a custom domain.) But if you want different code to run on different pages, you’ll check something like the window.location.pathname for what page you’re on, e.g. if (window.location.pathname == '/') { // Blog index page } else if (window.location.pathname.lastIndexOf('/tag:') == 0) { // Blog tag pages } else { // B…

---

_[View the full topic](https://discuss.write.as/t/javascript-in-post/446)._
