Javascript error for ie9 - flickrshow gallery - javascript

I have a page with two flickrshow galleries on it. They both work fine in FF, Chrome, Safari, ie6+ but not ie9. I am fixing various js problems by using
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
to emulate ie8. Problem is that there is still an error for the js and ie is throwing up the 'webpage error, do you want to debug' message each load.
Using the Debugger, error is:
SCRIPT5007: Unable to get value of the property 'removeChild': object is null or undefined
flickrshow-7.2.min.js, line 11 character 4468
The line of the flickrshow js that gets highlighted with the error on:
a.elements.script.parentNode.removeChild(a.elements.script)
Suggestions please, thanks

Since you haven't given much context for your code. Try logging a.elements.script.parentNode and a.elements.script and a to see if you actually are getting the elements your expecting. From the error I assume since it has something to do with IE not getting the HTML element correctly. However, it could be something with a I'm assuming it is a variable for something, but I'm not sure what.

Related

ajaxToolkit AutoCompleteExtender Chrome error

Facts:
ajaxToolkit AutoCompleteExtender in this specific screen works fine in IE, and Firefox
ajaxToolkit AutoCompleteExtender works fine in Chrome, in a different screen, same application
But not here. Right now I am getting errors like this:
Uncaught Error: Sys.InvalidOperationException: Type
AjaxControlToolkit.Animation.Animation has already been registered.
and
Uncaught Error: Sys.ScriptLoadFailedException: The script
'http://abc/def/ScriptResource.axd?d=uZ7YXSkj4n5b51-4hy2B1kBoyWBzAKQobQalIia8aju5_q790-3ZI8fdE9mfezSEesp77ToyxGv7_erOfA-X853srHT0dJkwMzZ98t3kSUkbkMEhd1StAYZDits_77x15a31Dr-0FO4ytW-aNwix2qkS_181&t=634263938860000000'
failed to load. Check for: Inaccessible path. Script errors. (IE)
Enable 'Display a notification about every script error' under
advanced settings. Missing call to
Sys.Application.notifyScriptLoaded().
Anyone ever had any issues like this?
Scriptresource.axd is not something I tried to change before, so I am feeling totally lost.
So after a lot of debugging, I removed the UpdatePanel from the screen, and it is working fine in Chrom, Firefox, and IE as well.

Chrome and a TypeError due to SVGAnimatedString

When I click on an SVG element I get an error on Chrome but not on Firefox.
If I use the Chrome's debugger it breaks in bubble_compiled.js (Google's file) with an 'Uncaught TypeError: undefined is not a function'.
I know the underlying issue stems from ''.className returning an SVGAnimatedString (which doesn't have an indexOf method) and the correct thing to do is use .classNam e.baseVal but again this error is not part of my code rather it's part of google's code.
Here is a basic example:
<!DOCTYPE html>
<html>
<head>
<script>
function err() { alert('err'); }
</script>
</head>
<body>
<svg style="width:200px;height:200px; background-color: #00B7FF" onerror="err()"></svg>
</body>
</html>
Unfortunately this means that I can't debug my code that involved interactions with an svg element because Chrome debugger breaks on this error on mousedown.
Interestingly I didn't see this problem until two days ago (May 14th) and I've been developing such code for several years. I'm using Chrome 42 on the mac and I've tried using Chrome 40.0.2214.91 (64-bit) but now I get the same error (yes, I disabled Chrome automatic update :-) I don't see the problem in Firefox (with or without a debugger).
Another interesting observation is that the error doesn't occur if I load the above html from a file rather (file://) than via a server.
I tried to circumvent it by adding an indexOf() to SVGAnimatedString (or its prototype) but this is native code and it doesn't work.
Adding onmousedown to the svg element doesn't help because the exception occurs before my function is called.
All I need for now is a way to tell Chrome not to break on this error.
Turns out the issue is due to Google's Translate extension. Disabling it solve the problem.

IE9 jQuery load order issue

I have a page that is quite jQuery reliant.
The functionality on the page works fine in all browsers, except IE9.
This I understand is down to the issue with IE9 where Javascript can load very slowly.
The problem I face is that the page, once loaded thinks that Javascript is not available.
An error I am seeing in the console is:
SCRIPT5007: Unable to get property 'length' of undefined or null reference
File: jquery-1.8.3.min.js, Line: 2, Column: 14331
For the record, the jQuery lib is loaded before any other js files.
I have tried to get around this issue by adding the following code into the head, to try and force IE9 into IE8 mode. Note by default for IE we force 'edge' mode.
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!--[if IE 9]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<![endif]-->
However, this makes no difference.
Before anyone asks why we're relying on IE9, it is a business requirement.
Does anyone have any idea how I can get the page to render in IE8 mode if the bowser accessing the page is IE9?
Many thanks in advance.
I should add, the page in question has a 'noscript' check on it, so will not render if JS is not available. This is true ONLY in IE9. For all other browsers, the page will render fine.
I'm wondering if the above error is something else...
For the record, I have been looking at this IE9 JavaScript error: SCRIPT5007: Unable to get value of the property 'ui': object is null or undefined thread.
As I understand it, this is an issue with jQuery under IE9, which was fixed at some point after jQuery 1.8.3.
So the issue can, in all probability, be fixed by using a later version of jQuery.
At this time, I would opt for jQuery 1.11.0. Don't be tempted by the 2.x series, which deliberately omits lots of backward compatibility stuff.
Unfortunately, this will mean requalifying everything that uses jQuery, which is a pain.
OUr issue was down to IE not recognising the 'console' command.
As we were running a number of console.log commands, when this part of the code was reached in IE9, it stopped, and prevented any other JS from loading.
So the fix we have implemented is: If console not defined (IE9), define an empty object literal
if(!(window.console && console.log)) {
console = {
log: function(){},
debug: function(){},
info: function(){},
warn: function(){},
error: function(){}
};
}
This seems to be working for us now. :)

Postback with HTML Editor Extender on page causes JavaScript error in IE11

I have added an HTML Editor Extender to the page I'm working on and now ANYTIME I cause a post back on the page I get the following Javascript error:
JavaScript runtime error: Invalid argument.
And nothing happens after that. This works fine in IE10 or below and all other browsers that I'm aware of, however it does not work in IE11 which I need it to work in. Does anyone know of any fixes for this issue?
It looks like it's a known issue with the AjaxToolKit.
Try inserting this below the head tag:
<meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1" />

Unable to get property 'replace' of undefined - only in IE9

I only receive this error in Internet Explorer 9. IE7, IE8 and IE10 run the script fine. It is a banner of fading images, one after the other all stacked and fade in to each other.
When you attempt to load the page on IE9, it throws an error. The error occurs within prototype.js and I get this error.
SCRIPT5007: Unable to get property 'replace' of undefined or null reference
prototype.js, line 334 character 24
Why would this happen in IE9 but not any earlier version??
I was getting the same error message, because I was using a .html() operation on an XML tag.
var myXML = '<someTag att1=""><cell></cell></someTag>' ;
$(myXML).html(); // which was giving the error msg.
// Instead use the below option
$(myXML).children() ;// instead this work with IE
Note: Above example is not what I actually tried, it's just to give a representation of the problem.
You should try using the X-UA-Compatible tag. Many libraries do not work well with IE9 and need to be run in IE8 compatible mode.
<meta http-equiv="X-UA-Compatible" content="IE=8" />
I've resolved the issue after a few hours of hair pulling and teeth grinding.
I did not realize that scriptaculous was reliant upon prototype.
I was updating prototype while leaving an outdated version of scriptaculous effects linked which was throwing many errors.
After updating to scriptaculous 1.9 and then updating prototype to 1.7, all was well and no errors are thrown.
Thank you all to those who helped, I appreciate all the comments!
Well, most of the time this error occures because of the .html() operation in jquery to parse XML. Remove this and use .text() instead will solve the problem.

Categories

Resources