admin管理员组

文章数量:1291091

Like allways, in Firefox, Chrome, Safari and Opera everything works without a problem. But IE... This is another story :)

Here is my full code:

At least one thing good in IE, e to me with the following error:

SCRIPT65535: Unexpected call to method or property access. 
jquery.min.js, line 3 character 29586

What is wrong? I can't find a bug :(


UPDATE

I cleaned up my code, javascript functions are now called as a jQuery plugin. I am still getting an error, but now I know where.

In my code I put a ment IE ERROR next to the code where IE alert the error message.

PLUGINS:

jQuery :

I have no idea why IE breaks there.. Any solutions?


Regards, Mario

Like allways, in Firefox, Chrome, Safari and Opera everything works without a problem. But IE... This is another story :)

Here is my full code: http://pastebin./ZdzzFayJ

At least one thing good in IE, e to me with the following error:

SCRIPT65535: Unexpected call to method or property access. 
jquery.min.js, line 3 character 29586

What is wrong? I can't find a bug :(


UPDATE

I cleaned up my code, javascript functions are now called as a jQuery plugin. I am still getting an error, but now I know where.

In my code I put a ment IE ERROR next to the code where IE alert the error message.

PLUGINS: http://pastebin./6Dnd1qtd

jQuery : http://pastebin./wiHALjZx

I have no idea why IE breaks there.. Any solutions?


Regards, Mario

Share Improve this question edited Nov 25, 2011 at 13:37 Puzo asked Nov 24, 2011 at 22:30 PuzoPuzo 5982 gold badges11 silver badges27 bronze badges 1
  • You really need to test those functions in isolation and determine which one is giving you trouble; then maybe we can identify an errant line. Asking us to go on a scavenger hunt through all that code is not a good idea. – lsuarez Commented Nov 24, 2011 at 22:43
Add a ment  | 

3 Answers 3

Reset to default 3

For me the problem was the following:

i use a lib where is applied on all environment.

my_lib.js

jQuery.ajax({
        data : jQuery('form').serialize(),
        url : '/'+action[1]+'/post_form',
        type : 'POST',
        dataType: 'json',
        success: function(data){
            $('#my_name_id').find('option').remove().end().append(data.select_options);

});

Json returns:

select_options  "<option></option>"

Everything is fine! BUT, in one form #my_name_id is not a select, is a hidden field, it's a pre-selected value and disabled attribute for the user.

That's why jquery on IE8 retrieves me the error.

The solution was:

my_lib.js

jQuery.ajax({
        data : jQuery('form').serialize(),
        url : '/'+action[1]+'/post_form',
        type : 'POST',
        dataType: 'json',
        success: function(data){
          if( $('#my_name_id').is('select') ) {
             $('#my_name_id').find('option').remove().end().append(data.select_options);
          }
});

Hope it helps somebody!

You appear to be missing a semi-colon in your get_data function after echo_data(data).

request.done(function(data) {
    if (data) echo_data(data) _loading.hide();
    _ads_listing.unmask();
});

I solved the problem in the following way:

  • Clean up my code ( JSHint was very helpful! )
  • Before anything I included "//html5shiv.googlecode./svn/trunk/html5.js" to IE recognize that I am using HTML5 tags such as section, header,...
  • In jQuery plugin I fill element with html content. Instead of using $(defaultOpts.data_container).html("HTML CONTENT") I use defaultOpts.data_container.html("HTML CONTENT"). So I send object element $(#ID) in parameter to plugin instead of sending just element ID "#ID".

Now, everything working OK. Thank you all for your support and effort.

本文标签: phpStrange jQuery error in IE Unexpected call to method or property accessStack Overflow