0

I have page on which I am using some third party controls. This assembly is loading jQuery version 1.3. But in my application master page I am using jQuery 1.8.3 due to which my page is not working properly. It is showing the below error message.

Microsoft JScript runtime error: Object doesn't support this property or method

Is there any way that I can solve this issue?

Thanks,

Praveen.

4
  • why can't you use version 1.3 on your master page? Commented Feb 19, 2014 at 10:15
  • 1
    Maybe this could help. stackoverflow.com/questions/1566595/…
    – MJZ
    Commented Feb 19, 2014 at 10:15
  • 1
    There is jQuery noConflict() but better would be to use only the most recent jQuery version and upgrade older plugin
    – A. Wolff
    Commented Feb 19, 2014 at 10:15
  • I am targeting the application to work in latest browsers. So I am planing to use latest JQuery version.
    – praveen
    Commented Feb 19, 2014 at 10:17

1 Answer 1

1

You should try to update the scripts to work with the newer version of jQuery. If that's not possible then you can use the jQuery.noConflict() method to create a safe reference to chosen version.

<script type="text/javascript" src="//code.jquery.com/jquery-1.3.min.js"></script>
<script type="text/javascript">
    var $1_3 = jQuery.noConflict(true);
</script>

<script type="text/javascript" src="//code.jquery.com/jquery-1.8.1.min.js"></script>
<script type="text/javascript">
    var $1_8_1 = jQuery.noConflict(true);
</script>

You should be able to use it in the code:

$1_3.trim("   abc    ");   // "abc";
$1_8_1.trim("   abc    ");   // "abc";

It's not a perfect solution and I would recommend to use one version of jQuery only.

Not the answer you're looking for? Browse other questions tagged or ask your own question.