Support Rules and Guidelines
Before you post your support topic, please remember to:
  • Read the support forum rules.
  • Check the wiki and use search to see if your problem can be answered there first.
  • Link your board please, and make sure that the problem on your board is visible to guests or provide a test account.
  • Do not post Board Wrappers and CSS unless requested. With a board link, this is not necessary.
  • Be as descriptive as you can and use as many details as possible when describing your problem.
  • Please briefly mark any links to forums that may not be work-safe.
This will help ensure your support issue will be attended to in a quick and efficient manner.

  Add ReplyNew TopicNew Poll

 Can you use JQuery on custom BBCode?
Hey there!

So I'm pretty new on Jcink. I've been in this service since April, which is last month and that should mean I'm new here.

I'm kinda struggling with using the Custom BBCode. Let's just say I'm making a spoiler BBCode, which looks like this:

<script>$("#spoiler_toggle").click(function () { $(".spoiler").toggle('slow'); });</script><div id="spoiler_toggle">(PARAM1)</div><div class="spoiler" style="display:none;">(PARAM2)</div>

I'm using it on my test board, and it doesn't seem to work. I'm using it on JSBin and it works just perfectly. So my question is, can you use JQuery when you're creating a new custom BBCode? Or can you not?

That's it, thanks for the answer!
JavaScript insertion like that in the <script> tags isn't really supported in the BBCode system. You have to intergate it as an attribute, or use the javascript outside of the bbcode itself and in the board wrappers.

Here's an example of a spoiler code that uses the onclick attribute and can be put in the bbcode's html:

<div class="tableborder"><div class="maintitle" align="center" onclick="$(this).next().toggleClass( 'fade' )">Spoiler Alert</div><div class='unfade'>(PARAM1)</div></div>

email: :: blog: John C.
Oh I see, so you can't insert a <script> tag in the Custom BBCode...
How about styling? Can you insert a <style> tag in the Custom BBCode?
You could I believe as long as it's kept all on one line.

email: :: blog: John C.
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Share this topic:
« Next Oldest | General Support | Next Newest »

Options Add ReplyNew TopicNew Poll