MyBB Community Forums

Full Version: I am trying to use MyCode to enable Javascript. It's not working.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

- I am trying to get a code editor to work inside forums
- the code editor I am trying to embed is: Ace Editor
- I enabled HTML
- I am the only one who accesses this forum, and I understand the security concerns.

I am trying to enable Javascript for the Ace Editor to work.
I tried the MyCode workaround from: querschlaeger from here, but it's not working.
For example, if I try
[javascript]
    var a = "hello world!";
    document.write("text" + a);
[/javascript]
it will show up as plain text
Try to do your MyCode an one-liner, I think MyBB adds breaks to any MyCode. Try to use the console or provide more information into why it doesn't seem to work too.

Example:
https://community.mybb.com/thread-65621-...#pid473497

Note that both the replacements and examples are one-liners.
One liner works, which is great enough, but is there a way to just make copy/paste code work directly?

EDIT:
+ One liner executes, but it doesn't show anything
+ nothing shows in the message of post/thread
+ if I use "alert" function it does show an alert

EDIT:
please hold, I mixed things up...
+ Javascript in general works.. which is great!
+ I'm trying to get the Ace editor to work
Quote:One liner works, which is great enough, but is there a way to just make copy/paste code work directly?

Suggestions that would improve this have been made but it is possible they will be applied in 1.9 or later.
Please note that it is possible to code a plugin to handle the MyCode, working around this issue.