Turn scripting capabilities on

By default scripting capabilities are turned off in Office 365. This will prevent the use of a set of settings and a larger number of web parts.
The administrator of the environment can enable scripting in SharePoint admin center. When scripting is turned on it takes about 24 hours for the change to take effect.

Solution
1. Sign in to Office 365.
2. Open the admin center.
Open Admin Center
3. Open the SharePoint admin center.
Open SharePoint admin
4. Click on settings.
5. Set custom scripting to allow.
Allow scripting
6. Save the changes and wait 24 hours.

The following web part, features are settings are effected by the turning scripting on/off. When scripting is disabled (off) these functions will be unavailable to administrators.

Effect Web parts and features
Web Part Category Web Part
Blog Blog Archives
Blog Notifications
Blog Tools
Business Data Business Data Actions
Business Data Item
Business Data Item Builder
Business Data List
Business Data Related List
Excel Web Access
Indicator Details
Status List
Visio Web Access
Community About This Community
Join
My Membership
Tools
What’s Happening
Content Rollup Categories
Project Summary
Relevant Documents
RSS Viewer
Site Aggregator
Sites in Category
Term Property
Timeline
WSRP Viewer
XML Viewer
Document Sets Document Set Contents
Document Set Properties
Forms HTML Form Web Part
Media and Content Content Editor
Script Editor
Silverlight Web Part
Search Refinement
Search Box
Search Navigation
Search Results
Search-Driven Content Catalog-Item Reuse
Social Collaboration Contact Details
Note Board
Organization Browser
Site Feed
Tag Cloud
User Tasks
Master Page Gallery Can’t create or edit master pages
Publishing Sites Can’t create or edit master pages and page layouts

 

Effected sites settings
Site Feature Behavior Notes
Save Site as Template No longer available in Site Settings. You can still build sites from templates created before scripting was disabled.
Save document library as template No longer available in Library Settings. You can still build document libraries from templates created before scripting was disabled.
Solution Gallery No longer available in Site Settings. You can still use solutions created before scripting was disabled.
Theme Gallery No longer available in Site Settings. You can still use themes created before scripting was disabled.
Help Settings No longer available in Site Settings. You can still access help file collections available before scripting was disabled.
HTML Field Security No longer available in Library Settings. You can still use HTML field security that you set up before scripting was disabled.
Sandbox solutions Solution Gallery will not appear in the Site Settings so you can’t add, manage, or upgrade sandbox solutions. You can still run sandbox solutions that were deployed before scripting was disabled.
SharePoint Designer Site Pages: No longer able to update web pages that are not HTML.
Handling List: Create Form and Custom Action will no longer work.
Subsites: New Subsite and Delete Site redirect to the Site Settings page in the browser.
Data Sources: Properties button is no longer available.
You can still open data sources.
Uploading files that potentially include scripts The following file types can no longer be uploaded to a library
.asmx
.ascx
.aspx
.htc
.jar
.master
.swf
.xap
.xsf
Existing files in the library are not impacted.

Add new page button

SharePoint has multiple ways to add pages. It can be done in the document library (pages) or through the settings drop-down menu. For most users these are not the most practical and easy. An easier and faster way is to simply add a hyperlink or button on a page for user to click on. My favorite method is to add a button on the page in SharePoint style. The hyperlink I am using is exactly the same as the hyperlink in the settings drop-down menu.

ButtonAddPage

Solution with hyperlink only
1. Edit the page where the button needs to be placed.
2. Add a Script Editor web part to the page.
3. Add the following code in the script editor.

 <a onclick="if (LaunchCreateHandler(&#39;PublishingPage&#39;)) { SP.SOD.executeFunc(&#39;sp.ui.dialog.js&#39;, &#39;SP.UI.ModalDialog.showModalDialog&#39;, function() { var dlgOptions = { url:&#39;\u002fsites\u002fknowledge\u002fBestPractice\u002f_layouts\u002f15\u002fCreatePublishingPageDialog.aspx&#39;, autoSize: true, autoSizeStartWidth: 550 }; SP.UI.ModalDialog.showModalDialog(dlgOptions); }); };" href="#">  
      new page  
 </a>  

4. Publish the page.

Solution with button SharePoint style
1. Edit the page where the button needs to be placed.
2. Add a Script Editor web part to the page.
3. Add the following code in the script editor.

 <div class="ms-comm-heroLinkContainer">  
   <a onclick="if (LaunchCreateHandler(&#39;PublishingPage&#39;)) { SP.SOD.executeFunc(&#39;sp.ui.dialog.js&#39;, &#39;SP.UI.ModalDialog.showModalDialog&#39;, function() { var dlgOptions = { url:&#39;\u002fsites\u002fknowledge\u002fBestPractice\u002f_layouts\u002f15\u002fCreatePublishingPageDialog.aspx&#39;, autoSize: true, autoSizeStartWidth: 550 }; SP.UI.ModalDialog.showModalDialog(dlgOptions); }); };" href="#" class="ms-textXLarge ms-heroCommandLink">  
    <span class="ms-list-addnew-imgSpan20">  
      <img class="ms-list-addnew-img20" src="/_layouts/15/images/spcommon.png?rev=23">  
 </span>new page  
 </a>  
 </div>  

4. Publish the page.