.join('/') not accepted

.join('/') not accepted


This is a continuation of my previous post… previous_post

I use schnack commenting sytem: SCHNACK

I successfully made a slack webhook.

In files:

const post_url = config.get('page_url').replace('%SLUG%', event.slug)+'#comment-'+event.id;

"page_url": "https://example.com/%SLUG%",

In blogpost:

<h1 id="try-schnack">
<a class="anchor" href="#try-schnack">
 Try schnack</a>
<div class="comments-go-here"></div>
<% var title = post.title %>
<% var slug = post.slug %>
<% var sluglink = [title,slug].join('+++++') %>
<script type="text/javascript"
	data-schnack-slug="<%= sluglink %>"

This all works. But I need output following: title/slug and NOT title+++++slug

If I do .join('/') then SCHNACK commenting system does not work at all anymore, it crashes. Strangely enough I can put any character in .join('XXXXXXXX') here but EXCEPT / and let that be the one I need.
I need the slash / as separator between title and slug, so my result is this: title/slug.

How to make that work?


Hello Ronnie,
I don’t see any issue with [title,slug].join('/'), if you log it, you will find out it will result in desired result as "title/slug"

You may please talk more detailed about the errors you get?

Is there any error log or something you may share please?

My guess is, the character / may cause some format issue for the API you are trying to work it doesn’t except it(/), so it may fail!

What about trying following?

line 21 of slack.js report problem to console, you may access the log files and share the error message please.

ASCII codes in Javascript (charCodeAt())


Hi Anon… thanks…

I will make console error report and post it. Sorry for delay, but I am not expert in using console yet. I cannot pinpoint it exactly. I trying.