Javascript

My website includes alearts and a copy to clipboard which works fine locally but seems to not work properly on here. Does this site interfer with Javascript?

can you post a link to the problematic page and describe what you mean when you say but seems to not work properly on here

4 Likes

Nope. JS is done by the browser not the server

3 Likes

Can you share the link to your page so we can take a look?

No, we don’t. Our servers serve the Javascript files you uploaded exactly as you uploaded them, and we don’t add, remove or change any code. Besides that, Javascript code is executed in the browser of the visitor, not the server, so we cannot change how code is executed.

One possible issue to consider might be that some browser APIs are blocked on websites that do not have HTTPS, with special exceptions for localhost URLs. But I think clipboard and alert APIs are not affected by this.


Besides that, I second what @lovebug said: please share a link to the page with the code that does not work, and explain what should happen and what actually happens so we can check the code itself.

7 Likes

It’s not there now. I tried to reupload it but it seems I have exceeded my ftp qouta with 35 kb worth of files. Thats seems low.

I’m new to JS but the code I wrote works locally in Linux and windows but not on your site.

Please provide the page URL so we can look into your issue.

Online file manager is a little bit buggy, and sometimes shows that error even if you didn’t reached limits. you should try uploading with an FTP client instead

6 Likes

Yeah I’ll try later. Site is empty now because I was adding features to the JS but the site didn’t change for some reason so I deleted the files to see if it was running from a copy of them. Really odd that I can make changes but nothing changes online.

Site is spp.infinityfreeapp.com/ but empty atm.

Found the issue. navigator.clipboard.writeText not working from web.

can you post a link to your javascript code

— edit — is this the file ? http://spp.infinityfreeapp.com/condition.js

1 Like

When I check the MDN docs of that function, it has an info notice at the top saying the following:

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

So like I suspected, you’ll need HTTPS on your site to use those functions.

6 Likes