Fix SharePoint Online Scripts Not Working After Migration
Question details
User is experiencing issues with JavaScript customizations failing in SharePoint Online classic views after migrating from older versions like SharePoint 2013 or 2016.
- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- Migrating customized environments from older SharePoint on-premises versions to SharePoint Online.
- Observed behavior
- Custom JavaScript that previously functioned correctly now fails to execute or behave as expected in the new environment.
Before seeking help, gather the exact JavaScript code that is failing and note any specific error messages shown in your browser's developer console by pressing F12.
Seek Assistance in the Microsoft Q&A SharePoint Development Forum
Since this involves custom JavaScript development and specific platform compatibility changes, consulting SharePoint development specialists is the most effective approach.
SharePoint Online has different security models, script execution policies (like NoScript sites), and architectural changes compared to SharePoint 2013 and 2016.
Because of these underlying changes, legacy JavaScript customizations often require rewriting or modernization, such as transitioning to the SharePoint Framework (SPFx).
Copy the complete failing JavaScript code into a text editor, ensuring you remove any sensitive or proprietary company information.
Navigate to the official Microsoft Q&A website and search for the SharePoint Development tag.
Create a new question detailing your migration path (e.g., 2013 to Online), the classic view scenario, and the specific script errors. Ask for modern implementation suggestions.
Switch to WPS Office for a Streamlined Document Experience
While you troubleshoot SharePoint script compatibility, you can rely on WPS Office for a free, lightweight, and highly compatible alternative to Microsoft Office for your daily document management and collaboration needs.
- 1. Download the installer: Visit the official WPS website and download the free WPS Office installer for your operating system.
- 2. Install the software: Run the downloaded file and follow the simple on-screen instructions to complete the installation.
- 3. Open and edit files: Launch WPS Office and instantly open your existing Microsoft Office documents without formatting loss.

Frequently Asked Questions
Why do my old SharePoint 2013 scripts fail in SharePoint Online?
SharePoint Online often blocks custom scripts on modern sites for security reasons. Additionally, classic views in SharePoint Online have updated underlying structures that may not support legacy DOM manipulation.
What is the recommended modern replacement for JavaScript injection in SharePoint?
Microsoft recommends using the SharePoint Framework (SPFx) for customizing and extending the user interface in modern SharePoint environments, as it provides a secure and supported development model.
How do I check if custom scripts are blocked on my SharePoint Online site?
Administrators can check the site's settings in the SharePoint Admin Center. Look under 'Settings' for the 'Custom Script' options to see if users are prevented from running custom scripts on personal or self-service created sites.




