2026-08-22 UTC
MD87, cotsuka, grufwub, ax562, WinnerWind, IWSlackGateway, chenghiz_, k3can8, [KevinMarks]1, [capjamesg], lavandula, Maxpm, lavandula_, kishy, sage_rakurai, thatoddshade, streety, barnaby, rMdes, Pixi, JadedBlueEyes1 and Guest7734 joined the channel
# 11:51 rMdes-bnc Damn b2.. I also remember B2 Evolution, which was a fork if I'm not wrong
lavandula, cotsuka, thatoddshade, lavandula_, [jeremycherfas], ZodiacalComet, barnaby, GuestZero, pimeille and IWDiscord joined the channel
# 15:57 ruecharli does anyone know how i can check if a file exists (in the same directory as the active page) with js? i need it to return a boolean
# 15:58 ruecharli i have the path and file name, but i dont want to navigate to it
# 15:58 ruecharli just check if it exists
# 16:04 [snarfed] js is client side. it can do HTTP, but not server-side filesystem access
cotsuka joined the channel
# 16:05 [snarfed] if the web server is serving that file, you can fetch it with eg the fetch API and check the response status code
# 16:15 ruecharli dang it, i assumed it would work :( im trying to check if another html page (on my site) exists before linking to it.. is there some way i can get the same effect? im not sure what fetch api is but i will look into it
# 16:16 ruecharli otherwise i will just have to have like, a list of all my html files that ill have to keep updated and read from
# 16:16 tdrayson what are you actually trying to achieve? maybe that might help with giving a better answer
# 16:18 ruecharli the whole site takes place in a book. every page has a page number and chapter number in the title. i need to know if the next page is in the same chapter before i try to link to it, otherwise it might move to a page that doesnt exist. i cant give each page its own page number because ill constantly be adding to the end of each chapter
# 16:19 ruecharli so, chapter 1 page 50 might be the last of the chapter, so it would need to move to chapter 2 page 1
# 16:19 ruecharli (each chapter is like a category. one would be for a blog, another for a gallery, etc)
# 16:20 tdrayson Page numbers don't change regardless of what chapter it is though, page numbers are always in order and don't restart
# 16:20 tdrayson Are you using any sort of content management system framework or anything like that? Because if it is an actual category, like a taxonomy, then you could get the total count of the category entries. But again, it kind of depends on how you are actually building this and what you are using.
# 16:21 ruecharli yes, i know, in a regular book, but i dont want to have to update every pages number because i added a new page near the start
# 16:22 ruecharli not using anything but html, css, and js. its all just in a folder on my desktop for now
# 16:22 tdrayson But would you not have to do that anyway, if you added a new page into page 2 of 50, then you still have to update the other 48 pages
# 16:23 ruecharli i guess? but i dont intend on doing that
# 16:24 tdrayson But your files are ordered, right, and named ?
# 16:24 tdrayson That's how you're getting the URL structure you mentioned above with the chapter and page number
# 16:25 ruecharli yes, with the convention (chapter).(page).html, e.g. 01.050.html
# 16:25 ruecharli i will generally only be adding to the end of a chapter
# 16:25 ruecharli dots because more convenient for .split
# 16:25 tdrayson You just said you might add a page into the start of a chapter?
# 16:26 ruecharli oh, in my first explanation? i mean that at runtime it needs to check if the next page is in the same chapter or the next, not creating anything
# 16:26 tdrayson Just keep an array of how many pages are in each chapter in the JavaScript
# 16:27 ruecharli ah ok, yeah that wouldnt be too hard to update
# 16:27 tdrayson If you add a new page, just update it
# 16:27 ruecharli ok, ill do that!
# 16:27 tdrayson That's going to be the simplest approach without having to do tones of fetch api calls and checks
# 16:28 tdrayson Then all you have to do is compare the current page number with the total pages in the chapter
morganwebdev joined the channel
# 16:48 ruecharli do i need to parseInt before comparing number strings? like, would "021" > "002" return true?
# 16:50 ruecharli nvm it works
Pixi, Virtual, sage_rakurai and ludovicchabant_ joined the channel
cotsuka joined the channel
# 17:35 ruecharli haha yeah i realised and fixed it
girlonthemoon joined the channel
# 17:49 ruecharli is there some js i can use that acts like an href hyperlink?
# 17:50 ruecharli i'd like to put it inside a click event listener
cotsuka, pimeille, [Tabitha], ax562, ax5623, barnaby, Saphire and rMdes joined the channel
# 19:51 tdrayson window.location.replace()
rMdes, cotsuka, thatoddshade, barnaby, rrix, [artlung], sage_rakurai2, pimeille, ax562, vikanezrimaya, ax5623, WinnerWind, tanok111, bterry and fluffy joined the channel