Announcement

Collapse
No announcement yet.

Embedding javascript into posts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Embedding javascript into posts

    Hi

    Does vB officially allow the embedding of javascripts into posts? For instance, embedding

    Code:
    [LEFT][COLOR=#007700][FONT=monospace]<[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]script type[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"text/javascript" [/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]src[/FONT][/COLOR][COLOR=#007700][FONT=monospace]=[/FONT][/COLOR][COLOR=#DD0000][FONT=monospace]"[URL]http://mediaplayer.yahoo.com/js[/URL]"[/FONT][/COLOR][COLOR=#007700][FONT=monospace]>[/FONT][/COLOR][COLOR=#0000BB][FONT=monospace]</script>[/FONT][/COLOR][COLOR=#000000][FONT=monospace] [/FONT][/COLOR][/LEFT]
    into a post.

    If there's no official support, then can this still be achieved?

    Thanks

  • #2
    No, allowing js or html is insanely dangerous. You can allow html, but I'm pretty sure we try to supress most javascript.


    Try on a demo: http://www.vbulletin.com/go/demo

    Comment


    • #3
      The way we do it is via a custom BBcode via a plugin.
      That way we get full safe control of the content but can apply a .js as needed.

      I wrote a how to here: https://www.vbulletin.com/forum/show...-vB4-1-8-howto
      environment: Centos 6.9, Apache v2.4.25, PHP 5.6.30/xCache, MariaDB 10.22 -- vB5 Connect Licensed

      AusPhotography - Australia's Premier Photographic Forum vB4.2.3
      Rick (site owner) and Kym (site tech) sharing this account

      Comment


      • #4
        Originally posted by ricktas View Post
        The way we do it is via a custom BBcode via a plugin.
        That way we get full safe control of the content but can apply a .js as needed.

        I wrote a how to here: https://www.vbulletin.com/forum/show...-vB4-1-8-howto
        So are you already embedding javascripts in posts with that method?

        Comment


        • #5
          Just testing <br /> <br />

          Line 3 <br />
          <hr />
          <b>bolded test in line 4</b>
          <p name="demo">line 5<u>underlined with html</u></p>
          <p>line 6underlined with vbcode </p>
          http://www.codeguru.com (url)

          Space above
          one
          two
          three
          alert("xxx">
          <script>alert("test 2"); </script>
          <script>
          function myFunction() {
          document.getElementById("demo").innerHTML = "Paragraph changed.";
          }
          </script>

          Comment


          • #6
            If HTML is enabled for a usergroup then yes Javascript would generally work in a post. However HTML is not enabled on this site and we don't recommend any customer ever enable HTML, it just isn't safe. Some customers do enable it but only for Administrators. It would be absolutely nuts to enable it for regular users.

            BB Codes are a way to try and make safe JavaScript accessible to all users if there is a need.

            Comment

            widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
            Working...
            X