MIME error on sharepoint error

t 21 Reputation points
2021-04-05T13:01:19.077+00:00

I am trying to reference a .js file uploaded to the site document library. but on ececuting it gives an error. please note that this did not exist before

code in solution
tag.src="link-to-the document.js"
tag.type=application/javascript.

But i am getting a MIME error , that says that refused to execute text/html.

where am i going wrong? also why is this issue appearing all of a sudden and it didnt exist before.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
6,049 questions
No comments
{count} votes

Accepted answer
  1. Jerryzy 10,301 Reputation points
    2021-04-06T02:35:21.597+00:00

    Hi @t ,

    Try to reference a Js file in SharePoint classic page like this, use "text/javascript" instead of "application/javascript":

    84638-snipaste-2021-04-06-10-34-49.png

    Thanks
    Best Regards


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    No comments

0 additional answers

Sort by: Most helpful