A user has added some custom JS code into a web-page, making it unusable.
Basically the ribbon cannot be opened, and web-parts cannot be modified.
Custom JS:
<script type="text/javascript">
tday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
tmonth=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
function GetClock(){
var d=new Date();
var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getYear();
if(nyear<1000) nyear+=1900;
var nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(),ap;
if(nhour==0){ap=" AM";nhour=12;}
else if(nhour<12){ap=" AM";}
else if(nhour==12){ap=" PM";}
else if(nhour>12){ap=" PM";nhour-=12;}
if(nmin<=9) nmin="0"+nmin;
if(nsec<=9) nsec="0"+nsec;
document.getElementById('clockbox').innerHTML=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+"";
}
window.onload=function(){
GetClock();
setInterval(GetClock,1000);
}
</script>
<div id="clockbox"></div>
The below are the errors I am getting through the browsers' debuggers:
Chrome:
Firefox:
IE11:
Web-Part athat was added (Content Editor with custom JS)
If I click any of the tabs 'Browse|Page|Publish' on the ribbon nothing happens and no errors are show in IE.
If I append ?ControlMode=Edit
to the end of the page's URL, in IE it will open in Edit mode but on other browsers it won't work.
Although it opens in IE, I still cannot modify web-parts. If I press the web-part's arrow in IE, nothing happens.
Could this be Javascript related? Maybe I need to link to it differently from the Master Page, or maybe some missing code in the page itself?
UPDATE:
Emulated IE6 - error:
SCRIPT5007: Unable to get property 'clientWidth' of undefined or null reference
Warning (in all versions):
SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
UPDATE 2:
Added a link to Core.js
in MasterPage.
Accessed page in 'Edit' mode by appending ?DisplayMode=Design&ControlMode=Edit#
to the URL.