I am trying to use MyCode to enable Javascript. It's not working.
#1
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
Reply
#2
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.
Reply
#3
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
Reply
#4
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.
Reply
#5
Please note that it is possible to code a plugin to handle the MyCode, working around this issue.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)