I have tried most of the suggestion I found on the searches and still can't edit the web part. I don't want to delete the entire web part as multiple users access the site daily. The problem is that I added some javascript in the body of the html and now the Page and Edit buttons do nothing. I just want to edit the web part and delete the javascript. I have tried ?contenst = 1, compatibility mode, etc. Nothing is working. Javascript just flashes when I click Page in chorme or firefox. I can edit the home/master page in designer, but it doesn't give me access to the html where the script is located.
2 Answers
You can try to trigger edit mode by entering the below in the end of your URL,
?ToolPaneView=2
Doing contents=1
would delete the entire web part which isn't what you'd want. If the script is making the page unresponsive or generally degrading the experience, then this may be your only recourse.
To fix it though, depends on how the script was implemented. If it is JS embedded into the page, then you need to open the page in SharePoint Designer and then be able to modify the script.
If the JS is stored as a separate JS file and linked in the CEWP, then go to the location where the file is stored and either download and edit it, or edit it in SharePoint Designer.
-
Well I've been trying for two days to use SharePoint Designer. It shows the home.aspx page, but doesn't show the part where the javascript is.– BillFeb 20, 2017 at 23:08
-
The script is inside the body of the html. I usually put it in the heading. it seems like an extra character may be in there or something. I just need to delete the script completely.– BillFeb 20, 2017 at 23:10
-
If you right click on the page in Designer and select Edit in Advanced Mode does it show up? It is unclear to me how you implemented the Javascript and how you manipulated it. Feb 21, 2017 at 0:54
-
That only showed things like RibbonCommand, contentplaceholderId, etc. I needed the entire html code. But as mentioned I just reverted to a previous version. Nothing else worked. Thanks– BillFeb 21, 2017 at 1:47