jQuery error in IE8 - .val() or trim()?

前端 未结 2 2099
北荒
北荒 2020-12-18 15:45

I\'m getting a jquery error in the IE8 debugger but I\'m not sure which function is causing it. I\'ve seen a whole bunch of posts here that state that IE8 doesn\'t support n

相关标签:
2条回答
  • 2020-12-18 15:52

    Change:

    $(":text", row).exists()
    

    To:

    $(":text", row).length > 0
    

    There's no exists() function in the jQuery library as far as I know (tried searching the API reference).

    0 讨论(0)
  • 2020-12-18 16:07

    Update: Due to new information, I think you come accross an issue with IE where it will have a conflict when you have a variable and a element IDed with the same name it will cause conflicts and confusing error messages about functinality not exitsting. See this reference for a more detailed explanation. http://www.karlstanley.net/blog/?p=5

    Original Answer: If you are having problems debugging a single complex line split it into parts,

    var tempValue = $(":text", row).val();
    new_email = jQuery.trim(tempValue);
    
    0 讨论(0)
提交回复
热议问题