jQuery: The Write Less, Do More JavaScript Library

Re: Jquery and ViaMichelin Maps Api Problem

by Godmar Back :: Rate this Message:

Reply to Author | View in Thread


Draft in case any jQuery developer wants to add that to their blog/plugins.

---
//
// Check for known compatibility issues.
//
(function () {
    function reportIncompatibility(msg, link) {
        document.write('<span style="color: red">Incompatibility
detected.</span><br />' + msg + '<br />');
        if (link)
            document.write('For more information, see <a href="' +
link + '">here.</a>');
    }

    // test if Object.prototype was extended.
    var emptyobj = {};
    for (var p in emptyobj) {
        reportIncompatibility(
              "Found property " + p + " in Object.prototype. "
            + "jQuery is not compatible with scripts that augment
Object.prototype.",
               "http://dev.jquery.com/ticket/262");
    }

    // add more here
})();

---

On Fri, Jun 6, 2008 at 8:36 AM, Godmar Back <godmar@...> wrote:

> One idea would be to write a compatibility check script
> "jquery-compatibility.js" that collects and stores the experience
> gained from debugging such compatibility issues in the form of
> JavaScript code. (If I recall, in a separate thread, a version of
> prototype was found incompatible because it changed Array.prototype in
> some way).
>
> This script, when included in the place at which otherwise jquery.js
> would be included, could check the environment for such conditions as
> whether properties have been added to the prototype of essential
> objects by already included scripts. It could also contain specific
> checks for properties added by libraries known to be incompatible.
> Since much JavaScript code is copied between sites, the same issues
> may reoccur. You could then point users to include the compatibility
> check script and if it flags anything, follow the instructions given.
>
>  - Godmar
>
> On Fri, Jun 6, 2008 at 4:28 AM, Adriano <adrianomassi@...> wrote:
>>
>> Yes, it would be great if somebody in Michelin would realize that
>> their API's are not compatible with one of the most widely used JS
>> framework and rush to fix the problem...
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

 « Return to Thread: Jquery and ViaMichelin Maps Api Problem