[Resolved] user-script.js is working?

    • August 18, 2022 at 12:57 am #11342
      A
      QTSWISS
      Participant

      Hi, i have problem with osTicket Awesome. When i add to user-scripts.js own code in ost and check osticket page, code is not working i dont now why. Mayby any one know what i doing wrong. Below my code:

      document.addEventListener('DOMContentLoaded', ()
      => {document.querySelector('body').innerHTML = document.querySelector('body').innerHTML.replaceAll('To better serve you, we encourage our Clients to register for an account.','replaceText');}, false);

      SPEC:

      osTicket v1.16.3 // osTicket-1.16.3-Awesome-101
      PHP 8.0.21 // MySQL 10.3.34 // Apache/2.4.41 (Ubuntu) web server

    • October 8, 2022 at 11:05 pm #12024
      stevland
      Keymaster

      Most people don’t even know about that file. 

      It’s been a long time since I used it, so I thought maybe it was broken.

      I added some simple jQuery:

      $( "body" ).replaceWith( "<h2>Test is successful</h2>" );

      And it worked as expected:

      There is something wrong with your code. My console returns this:

      Uncaught SyntaxError: Unexpected token '=>'

You must be logged in to reply to this topic.

Topic Tags