Could not complete the operation due to error 80020101 in IE - javascript

I am using jQuery 1.7.2 and lighbox in my website.
The HTML code which I want to load in lightbox is following:
//script type="text/javascript">
//jquery code
</script>
//html code..
While using firefox and chrome there is no problem while opening lightbox,
but while using IE it is displaying following error:
SCRIPT257: Could not complete the operation due to error 80020101.
jquery.min.js, line 2 character 11497..
When I change script type from text/javascript to text/html, lightbox opens fine but now javascript code doesn't work...

I have encountered this issue, as well. I have been using jQuery 1.7.2 and I am unable to get past this.
A solution was posted as being implemented in jQ 1.8.2, but that did not affect my results.
I changed my character encoding to UTF-8 (another suggestion I encountered), but that also did not help.
Eventually I rolled back to jQ 1.4.2 (the next previous version stored locally) and the problem went away. I know this isn't a "solution" but it's a workaround that got me back in the game and moving towards a deployable EAR.

You have a Javascript code that can't be correctly evaluated. I had exactly the same scenario and the solution was to change the name of an associative array key from class to "class" (this is only one example of evaluation error).
For more details, please see this answer

Related

IE 11 showing error when i clicking with jquery function

IE so much confusing me with some errors like this,
SCRIPT1002: Syntax error
File: jquery-2.1.4.min.js, Line:2 Column 2538
The weird thing is , on firefox and chrome running well and no error.
And some button with jquery click function is working.
I'm Using IE 11
Before this i'm using jquery-1.1.13.min.js and when i use jquery 2.0 it still running properly on firefox and chrome
I'm really new with cross browser so any info will helping me very much, thanks :)
For the record I had this error which only showed itself on IE when doing cross-browser testing of a big Javascript code change.
In my case the problem was a function definition which included what would be a default in any other language:
i.e. Function Foo(param1, param2, param3=false)
.. clearly this was a stupid bit of code .. but it took me a while to track down so this might help someone out there. Doesn't show up in Chrome, FF, or even Edge.
Mostly these errors are not problems of jQuery itself. The problem situates in code using jQuery or inserted into jQuery (callbacks or event functionalities). In my case I used $.ajax to load a remote page in a div element. In the page I loaded there where // comment tags in the javascript part. As IE is putting this content on one line, more code that as I wanted was commented and this created the error.
So if in our case us are using $.ajax maybe this can be an issue. Otherwise best thing to do is debugging the code that generates this error and look for code that is not supported by IE (the version you use). Look for functions passed trough to jQuery.

Changing javascript to jQuery first time Struts 1.3 application

I am changing the javascript in my project to jquery. This is the first time im using Jquery and expect me to be making silly mistakes please.
I placed a simple JQ alert function in a .js file which looks like below.
$(document).ready(function(){
$("#stt").change(function(){
alert("hi");
});
});
So the aim is to throw an alert msg when the value of a td element with id="stt" is changed.
<tr id="stttr">
<td id="stt"> <html:text property="stt" size="20" maxlength="20" style="height:12px; width: 180px;" /></td></tr>
and this is how im referencing jquery between the head tags of the jsp.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9/jquery.min.js"></script>
<script src="javascript/SearchPanelJQ.js"></script>
<script src="javascript/CalendarPopup.js"></script>
The Calendarpop.js is an older javascript file which i dont want to replace (it works fine on all browsers).
Now when i visit this page in a browser with script debugging enabled in IE, i get the following error .
HTML1201: localhost is a website you've added to Compatibility View.
ReportingTemplate.jsp
SEC7115: :visited and :link styles can only differ by color. Some styles were not applied to :visited.
ReportingTemplate.jsp
SCRIPT5007: The value of the property '$' is null or undefined, not a Function object
SearchPanelJQ.js, line 1 character 1
The last line tells me something is not right with the setup. Can you tell me what?
I installed the jsdt jquery plugin and am using JQ v1.9.
The project is a struts project.
Edit:
1) It works when the JQ function is included in the jsp. it dosent work when its in a different .js file.
2) even if i include http:in the reference, it only works when the document.ready function is in the same JSP and not when it is in a different .js file. This beats the purpose as the same validations will be used in multiple pages in my project.
for future reference:
Run in Chrome (or any browser as other users have pointed out)
Right click > Inspect Element > Console
Read error logs (Console can provide js, php, and other errors to help pinpoint specific lines where the malfunction is happening)
Your
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9/jquery.min.js"></script>
should be
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9/jquery.min.js"></script>
The reason, provided by user2736012 is:
OP is using a "protocol relative" url, which automatically uses the protocol that was used for fetching the page. In this case, if the protocol is file://home/User/Desktop/foo.html, the protocol relative url becomes file://ajax.googlapis..., which of course won't work. But it'll work when fetching the page using http, because it'll then be http://ajax.googleapis...
I found the issue. I am referencing JQ version 1.9 because i read in a tutorial that it should automatically pick the latest version in the 1.9 series. It works if i change it to 1.9.0 or 1.9.1. However, i still dont understand why 1.9 didnt work. it should have picked the latest 1.9.* version.
But atleast by making it 1.9.1/0 it works from a .js file.
the link for library is right, check it here!
look at this line
SCRIPT5007: The value of the property '$' is null or undefined, not a Function object
SearchPanelJQ.js, line 1 character 1
Something wrong with this library or conflict occurred.

FancyBox Jquery Null Error - Strange issue

I am experiencing a very strange issue i am hoping someone can answer (its kind of broad, but i will explain it my best), code works on local page when opened, but as soon as the same page is uploaded it throws an error. Two others have also looked at this, resulting in more confusion.
I downloaded FancyBox to use the inline feature to pop up a user form via href link, instead of taking the user to an additional page.
You can see the "stock" fancy box here:
1 fancyapps.com/fancybox/demo
Under various options, Inline is what i am using.
I didnt need all of the other features that came with FancyBox so i stripped the page to the following, which works just fine:
2 *Fancy Box Demo Stripped to Inline Feature only*
So then, i applied this code to our sandbox copy of the page to implement:
3 *Sandbox Copy with Fancy Box inline feature added to "make offer" link*
It stops working! There are no conflicts with other javascript on the page, and the only difference is that it has a couple of color .css changes, all .fancybox was named to .ptroffer and that the css code is not inline on the page (which wouldn't cause this error anyway).
This same page, opened locally works beautifully - upload and it throws error.
SCRIPT5007: Unable to get value of the property 'ptroffer': object is null or undefined
<script type="text/javascript">
$(document).ready(function() {
$('.ptroffer').ptroffer();
});
</script>
Works fine with link #2, and with link #3 locally, but with #3 uploaded it throws error.
Please!
Something in your code somewhere is overriding $. If you change that "ready" handler to call
jQuery('.ptroffer').ptroffer();
you won't get that error. However, things may not work; I think that an older version of jQuery is being imported by something (1.3!), which is bad.
edit oh I see, something's pulling in Prototype. You've got a regular script soup going on there, and things are going to be unpredictable and bizarre until you get that straightened out. Probably somewhere in there something's calling jQuery.noConflict(), but that "ready" handler you're adding isn't written to expect that. Whatever code that's expecting jQuery 1.3 may be in for a surprise also.

Jquery Error in ie8 and ie9 with Wordpress theme. (Object doesnt support this property or method)

I recently launched a website for a client http://www.bridgechurch.us/ only to recieve complaints of it not displaying correctly on ie8 or ie9. I have confirmed this to be true. IE is pointing to this line of Javascript:
jQuery(function () {
jQuery(".scrollable").scrollable({circular: true}).navigator().autoscroll({interval: 7000});
[...]
Can anyone help me figure out what is wrong with this line of code?
Thank you
UPDATE - FIXED
I figured out that there was a comment before the Doctype Declaration that forced IE into quirks mode.
You have a lot of 404's on that page, mainly related to ie-specific css and border images, which is probably why the page doesn't look like it should. Files like /images/internet_explorer/borderBottomRight.png and /wp-content/themes/Moses/styles/default.css aren't loading.
That being said, looking at the scrollable documentation, there is no .navigator() function off of the return value of scrollable(); and I'm getting the same error in Chrome.
Well, visually, the site doesn't appear to work well at all in IE9 (compared to Chrome). But just looking at the code that adds scrollable() to jQuery, you can see that that function doesn't always return the original element. In your code, if you split the call into two, you might be ok:
jQuery(".scrollable").scrollable({circular: true});
jQuery(".scrollable").navigator().autoscroll({interval: 7000});
I blame the plug-in on this one: functions that extend jQuery are supposed to always return the original elements found by the selector.

jQuery (or something) is not working properly on IE8

UPDATE:
I was told to test this in IE9 - It works fine in IE9 (for me,
anyways).
I was told by a friend that THIS page is not running properly on IE8 - I was told that the thumbnails are loading properly, but the image in the center is not. I do not have IE8 and I have been unsuccessful in my attempt to download it.
The images are being loaded (well, adjusted) through jQuery and I have a feeling that it is my javascript code that is failing in some way, causing the described errors in IE8.
I put my code through JSLint and the errors I saw were telling me to add spaces in the code - but I highly doubt this could be causing the IE8 issue.
The JS file being loaded is "slideshow.js" which can be easily found through Chrome's inspect element.
I will keep inspecting this from my end looking for JS errors and what not but I would really appreciate some help on this issue.
Thank you very much,
Evan
Problem looks to be
.img-wrapper in style.css with position:absolute.
The problem was that IE8 does not support the "naturalWidth" property. Rather, one should create a new image object, and get the "width" from this new image object.
For more details, refer to this link..

Categories

Resources