.join('/') not accepted

.join('/') not accepted
0

#1

This is a continuation of my previous post… previous_post

I use schnack commenting sytem: SCHNACK

I successfully made a slack webhook.

In files:

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

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

In blogpost:

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

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?


#2

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?
[title,slug].join('\/')

Edit:
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())
#3

@anon18662199

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.