<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic A Practical Approach to SharePoint Customizations After Custom Script Restrictions in Software - General</title>
    <link>https://community.hpe.com/t5/software-general/a-practical-approach-to-sharepoint-customizations-after-custom/m-p/7269518#M1557</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Introduction&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Microsoft's recent security updates in SharePoint Online have changed how custom scripts are handled, preventing inline JavaScript and CSS from executing through the Script Editor and Content Editor web parts in&amp;nbsp;Classic and Modern pages. While these changes strengthen platform security, they also impact many existing SharePoint customizations. In multiple SharePoint projects, this challenge was addressed by implementing a practical workaround that externalized JavaScript and CSS files while preserving the required functionality.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Business Need&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The SharePoint solution required was a custom client-side functionality to improve the user experience beyond the out-of-the-box capabilities. The requirements included:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Implementing custom JavaScript for business logic and user interactions.&lt;/LI&gt;&lt;LI&gt;Applying custom CSS to align the SharePoint pages with the organization's branding.&lt;/LI&gt;&lt;LI&gt;Keeping the solution lightweight without introducing unnecessary complexity.&lt;/LI&gt;&lt;LI&gt;Making future maintenance and enhancements simple for the development team.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Ideally, these requirements could be achieved by adding JavaScript and CSS directly into the Script Editor or Content Editor web part. However, Microsoft's recent security updates changed this behaviour.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Challenges in the Existing Process Before Restriction&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;After Microsoft's security enhancements, several issues were observed during implementation:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Script Editor web part no longer executed inline JavaScript.&lt;/LI&gt;&lt;LI&gt;JavaScript entered directly into the editor was ignored.&lt;/LI&gt;&lt;LI&gt;Inline CSS and styling were restricted, preventing page customization.&lt;/LI&gt;&lt;LI&gt;Existing customizations became difficult to maintain using the previous approach.&lt;/LI&gt;&lt;LI&gt;Rebuilding the entire solution using SPFx was not feasible for the project's timeline and scope.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;These limitations required an alternative solution that could preserve the required functionality while working within SharePoint's current security model.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution Implemented&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To overcome these restrictions, the custom code was separated from the SharePoint page instead of embedding it directly in the web part.&lt;/P&gt;&lt;P&gt;The implementation consisted of the following steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Created a dedicated JavaScript file containing all business logic as per the context.&lt;/LI&gt;&lt;LI&gt;Created a separate CSS file containing all custom styles also as per the requirement.&lt;/LI&gt;&lt;LI&gt;Uploaded both files to the SharePoint Site Assets library or create a document library inside Site Assets as per the project name and upload there.&lt;/LI&gt;&lt;LI&gt;Referenced these external files from the SharePoint page instead of writing JavaScript and CSS directly inside the Script Editor web part as shown below:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="InsertedCode.png" style="width: 982px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/157793iF2C513C29C29138C/image-size/large?v=v2&amp;amp;px=2000" role="button" title="InsertedCode.png" alt="InsertedCode.png" /&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;Organized the code into reusable modules so that multiple pages could use the same resources.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This approach kept the SharePoint pages clean while allowing the custom functionality and styling to load from centrally managed files.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Key Benefits&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;After implementing this solution, few advantages seen are as follows.&lt;/P&gt;&lt;P&gt;Centralized Maintenance -&amp;nbsp;All JavaScript and CSS are maintained in dedicated files, making updates much easier.&lt;/P&gt;&lt;P&gt;Reusability -&amp;nbsp;The same files can be reused across multiple SharePoint pages without duplicating code.&lt;/P&gt;&lt;P&gt;Cleaner Page Design -&amp;nbsp;SharePoint pages contain minimal embedded code, making them easier to manage.&lt;/P&gt;&lt;P&gt;Faster Enhancements -&amp;nbsp;Future changes require updating only the external JavaScript or CSS file rather than modifying every page individually.&lt;/P&gt;&lt;P&gt;Better Code Organization -&amp;nbsp;Separating business logic and styling follows standard web development practices and improves readability.&lt;/P&gt;&lt;P&gt;This approach enabled team to continue delivering the required SharePoint customizations despite the platform's security restrictions, without requiring a complete redesign of the existing solution.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Wrap Up&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Certainly, Microsoft's restrictions on custom scripts gives us more secure development practices, they can create challenges for projects that rely on lightweight client-side customizations. By moving JavaScript and CSS into external files and referencing them from SharePoint, it was easier to successfully maintain the required functionality in the project without a complete redesign. If you are facing similar limitations, this approach can serve as a practical and maintainable solution until a full migration to SharePoint Framework (SPFx) is required.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jul 2026 19:02:40 GMT</pubDate>
    <dc:creator>SaritaMishra</dc:creator>
    <dc:date>2026-07-02T19:02:40Z</dc:date>
    <item>
      <title>A Practical Approach to SharePoint Customizations After Custom Script Restrictions</title>
      <link>https://community.hpe.com/t5/software-general/a-practical-approach-to-sharepoint-customizations-after-custom/m-p/7269518#M1557</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Introduction&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Microsoft's recent security updates in SharePoint Online have changed how custom scripts are handled, preventing inline JavaScript and CSS from executing through the Script Editor and Content Editor web parts in&amp;nbsp;Classic and Modern pages. While these changes strengthen platform security, they also impact many existing SharePoint customizations. In multiple SharePoint projects, this challenge was addressed by implementing a practical workaround that externalized JavaScript and CSS files while preserving the required functionality.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Business Need&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The SharePoint solution required was a custom client-side functionality to improve the user experience beyond the out-of-the-box capabilities. The requirements included:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Implementing custom JavaScript for business logic and user interactions.&lt;/LI&gt;&lt;LI&gt;Applying custom CSS to align the SharePoint pages with the organization's branding.&lt;/LI&gt;&lt;LI&gt;Keeping the solution lightweight without introducing unnecessary complexity.&lt;/LI&gt;&lt;LI&gt;Making future maintenance and enhancements simple for the development team.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Ideally, these requirements could be achieved by adding JavaScript and CSS directly into the Script Editor or Content Editor web part. However, Microsoft's recent security updates changed this behaviour.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Challenges in the Existing Process Before Restriction&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;After Microsoft's security enhancements, several issues were observed during implementation:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Script Editor web part no longer executed inline JavaScript.&lt;/LI&gt;&lt;LI&gt;JavaScript entered directly into the editor was ignored.&lt;/LI&gt;&lt;LI&gt;Inline CSS and styling were restricted, preventing page customization.&lt;/LI&gt;&lt;LI&gt;Existing customizations became difficult to maintain using the previous approach.&lt;/LI&gt;&lt;LI&gt;Rebuilding the entire solution using SPFx was not feasible for the project's timeline and scope.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;These limitations required an alternative solution that could preserve the required functionality while working within SharePoint's current security model.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Solution Implemented&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To overcome these restrictions, the custom code was separated from the SharePoint page instead of embedding it directly in the web part.&lt;/P&gt;&lt;P&gt;The implementation consisted of the following steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Created a dedicated JavaScript file containing all business logic as per the context.&lt;/LI&gt;&lt;LI&gt;Created a separate CSS file containing all custom styles also as per the requirement.&lt;/LI&gt;&lt;LI&gt;Uploaded both files to the SharePoint Site Assets library or create a document library inside Site Assets as per the project name and upload there.&lt;/LI&gt;&lt;LI&gt;Referenced these external files from the SharePoint page instead of writing JavaScript and CSS directly inside the Script Editor web part as shown below:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="InsertedCode.png" style="width: 982px;"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/157793iF2C513C29C29138C/image-size/large?v=v2&amp;amp;px=2000" role="button" title="InsertedCode.png" alt="InsertedCode.png" /&gt;&lt;/span&gt;&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;Organized the code into reusable modules so that multiple pages could use the same resources.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This approach kept the SharePoint pages clean while allowing the custom functionality and styling to load from centrally managed files.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Key Benefits&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;After implementing this solution, few advantages seen are as follows.&lt;/P&gt;&lt;P&gt;Centralized Maintenance -&amp;nbsp;All JavaScript and CSS are maintained in dedicated files, making updates much easier.&lt;/P&gt;&lt;P&gt;Reusability -&amp;nbsp;The same files can be reused across multiple SharePoint pages without duplicating code.&lt;/P&gt;&lt;P&gt;Cleaner Page Design -&amp;nbsp;SharePoint pages contain minimal embedded code, making them easier to manage.&lt;/P&gt;&lt;P&gt;Faster Enhancements -&amp;nbsp;Future changes require updating only the external JavaScript or CSS file rather than modifying every page individually.&lt;/P&gt;&lt;P&gt;Better Code Organization -&amp;nbsp;Separating business logic and styling follows standard web development practices and improves readability.&lt;/P&gt;&lt;P&gt;This approach enabled team to continue delivering the required SharePoint customizations despite the platform's security restrictions, without requiring a complete redesign of the existing solution.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Wrap Up&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Certainly, Microsoft's restrictions on custom scripts gives us more secure development practices, they can create challenges for projects that rely on lightweight client-side customizations. By moving JavaScript and CSS into external files and referencing them from SharePoint, it was easier to successfully maintain the required functionality in the project without a complete redesign. If you are facing similar limitations, this approach can serve as a practical and maintainable solution until a full migration to SharePoint Framework (SPFx) is required.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2026 19:02:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/software-general/a-practical-approach-to-sharepoint-customizations-after-custom/m-p/7269518#M1557</guid>
      <dc:creator>SaritaMishra</dc:creator>
      <dc:date>2026-07-02T19:02:40Z</dc:date>
    </item>
  </channel>
</rss>

