Forum

user-script.js is w...
 
Notifications
Clear all

user-script.js is working?

1 Posts
2 Users
0 Reactions
24 Views
Posts: 4
Topic starter
(@qtswiss)
Member
Joined: 4 years ago

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


Posts: 1177
Admin
(@stevland)
Member
Joined: 2 months ago

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 '=>'


Reply
Share: