I have something going on that's almost backwards (IE8 being the hero!?)
My organization recently upgraded to SharePoint 2013 from 2007 and brought a whole slew of changes with it. One major change - Content Editor Web Parts now don't do so well with custom HTML, CSS, and JS.
Along with that we upgrade to IE9 (bit dated I know, don't rub it in). I have a script that has been running absolutely fine until the upgrades. Now with IE9 and SharePoint 2013, I load a document library with a Script Editor webpart and the code below and the page goes white.
I narrowed it down to this, but I don't know why. If I comment out the JQuery, everything loads again. The others are not a problem, just this for some reason.
<script type="text/javascript">
$(document).ready(function(){
$('.video').hide().before('<a href="#" id="toggle-video" class="button">Open/Close Video Tutorial</a>');
$('a#toggle-video').click(function() {
$('.video').slideToggle(1000);
return false;
});
});
</script>
On debug I get the following message in IE9+ but not IE8
"SCRIPT5022: DOM Exception: HIERARCHY_REQUEST_ERR (3) jquery.min.js, line 104 character 225"
Wonder if there's a way I can force this to render as if it were IE8..
Anyway thanks for your time!
Here's the full snippet.
<!DOCTYPE HTML>
<html>
<head>
<!-- JS -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('.practice').hide().before('<a href="#" id="toggle-practice" class="button2">Open/Close Practice Council View</a>');
$('a#toggle-practice').click(function() {
$('.practice').slideToggle(1000);
return false;
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('.policy').hide().before('<a href="#" id="toggle-policy" class="button">Open/Close Policy Central Live View</a>');
$('a#toggle-policy').click(function() {
$('.policy').slideToggle(1000);
return false;
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('.video').hide().before('<a href="#" id="toggle-video" class="button">Open/Close Video Tutorial</a>');
$('a#toggle-video').click(function() {
$('.video').slideToggle(1000);
return false;
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$('.resources').hide().before('<a href="#" id="toggle-resources" class="button2">Open/Close Resources</a>');
$('a#toggle-resources').click(function() {
$('.resources').slideToggle(1000);
return false;
});
});
</script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="policy">
<iframe src="http://XXX/XXX" width="100%" height="600">
</iframe>
</div>
<br><br>
<div class="practice">
<iframe src="http://XXX/XXX" width="100%" height="600">
</iframe>
</div>
<br><br>
<div class="video">
<center>No Video Available</center>
</div>
<br><br>
<div class="resources">
<center><p><a href="XX"> XX</a><br><br></p> </center>
</div>
</body>
</html>