I have made a similar kind of image viewer mentioned in below site for my website. http://www.javascriptkit.com/script/script2/backbox/ The image viewer is working fine in Chrome but not working in Internet Exlporer; I have not given my website details for security reasons but you view the issue by copy pasting below link in Chrome and Internet Explorer. http://www.javascriptkit.com/script/script2/backbox/
Click the Image in above link and see the error in internet explorer & see the same in other browser to see its working condition... PFB snap shot
Could any one of you tell why is not working in internet explorer ?
Error Msg from IE F12 devolper tools console area is :
SCRIPT5007: Unable to get value of the property 'replace': object is null or undefined effects.js, line 1 character 1747
effects.js = http://www.javascriptkit.com/script/script2/backbox/js/effects.js
If you need sample js files, please get that from http://www.javascriptkit.com/script/script2/backbox/backboxfiles.zip
HTML used is;
<link rel="stylesheet" href="backbox.css" type="text/css" />
<script type="text/javascript" src="js/prototype.compressed.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<script type="text/javascript" src="js/dhtmlHistory.js"></script>
<script type="text/javascript" src="js/customsignsheader.js"></script>
<div onclick="dhtmlHistory.add('location1',{message: 'backbox'});countdown()">
<a href="images/babyhand.jpg" rel="lightbox[slide]" caption="A Bunch of Grapes">
<img src="images/sunset.jpg" alt="lime" width="400" height="300" border="0" /></a>
</div>
<a href="images/desert.jpg" rel="lightbox[slide]" caption="Sunflower"></a>
<a href="images/beech.jpg" rel="lightbox[slide]" caption="Dolphin"></a>
<a href="images/lime.jpg" rel="lightbox[slide]" caption="Waterfall"></a>
<script type="text/javascript" src="js/customsignsfooter.js"></script>
You can simply make use of the <noscript> function to tell if JavaScript is enabled in your Internet Explorer browser. The <noscript> tag is used to control – or handle (whichever is appropriate) – websites that neither support scripting nor recognize the <script> tag.
Today, modern web browsers like Internet Explorer 11 have JavaScript enabled by default, allowing users access to enjoy user-interactive experiences on the internet. With JavaScript disabled, Internet Explorer users will be unable to view or experience dynamic features on web pages.
If JavaScript is turned off in your Internet Explorer, the <noscript> element will be displayed as an alternative text message. Open your Internet Explorer browser. With Internet Explorer now open, tap on the “Tools Menu” (Gear Icon). It’s located in the top right corner of the browser window.
Mac users who wish to turn on JavaScript in Internet Explorer can do so in just a few easy steps: From the tool section of the browser, select Internet options. Now open the Security tab and navigate down to the “Custom level”. Scroll down until you find the “Scripting” heading on the Custom level page.
regarding about your concern why this occurs in IE and not in chrome, that's because of this condition if(/MSIE/.test(navigator.userAgent)
which is true when your browser is IE
for correcting the issue, as you said in a comment you can add a 'undefined' condition.
just replace this line:
if(/MSIE/.test(navigator.userAgent)){Element.setStyle(_10,{filter:Element.getStyle(_10,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_11*100+")"});}
with:
if(/MSIE/.test(navigator.userAgent)){var filterStyle=Element.getStyle(_10,"filter");if(typeof(filterStyle)!="undefined"){Element.setStyle(_10,{filter:filterStyle.replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_11*100+")"});}}
and this line:
if(/MSIE/.test(navigator.userAgent)){Element.setStyle(_10,{filter:Element.getStyle(_10,"filter").replace(/alpha\([^\)]*\)/gi,"")});}
with:
if(/MSIE/.test(navigator.userAgent)){var filterStyle=Element.getStyle(_10,"filter");if(typeof(filterStyle)!="undefined"){Element.setStyle(_10,{filter:filterStyle.replace(/alpha\([^\)]*\)/gi,"")});}}
in the effects.js file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With