Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE8? #2

Open
amnesia7 opened this issue Oct 12, 2014 · 4 comments
Open

IE8? #2

amnesia7 opened this issue Oct 12, 2014 · 4 comments

Comments

@amnesia7
Copy link

Does this line https://github.com/komoot/leaflet.photon/blob/master/leaflet.photon.js#L54 mean that this plugin doesn't support IE8?

@amnesia7
Copy link
Author

I've checked the demo here (http://photon.komoot.de/) and it fails in IE8 because of the use of indexOf (https://github.com/komoot/leaflet.photon/blob/master/leaflet.photon.js#L150) and it fails in IE9 as well complaining of an Invalid character here (https://github.com/komoot/leaflet.photon/blob/master/leaflet.photon.js#L362).
Making indexOf work could be done using this (http://stackoverflow.com/a/3629211/1116573) to add the function if it doesn't exist or another option could be to use jquery's $.inArray() if jquery has been loaded.

@christophlingg
Copy link
Member

i am not so aware of that as @yohanboniface wrote the plugin. are you familiar with javascript and can make a pull request with ie support? that would be great!

@amnesia7
Copy link
Author

@yohanboniface
Something like this to replace L150 might help...

        var specialKey = false;
        for (var i = 0; i < special.length; i++)
        {
            if (special[i] === e.keyCode)
            {
                specialKey = true;
            }
        }
        if (!specialKey)

...although it only got me to the next bit of js that doesn't work in older IE which was here (https://github.com/komoot/leaflet.photon/blob/master/leaflet.photon.js#L353) in IE8 and I'm a bit stuck with the next issue about the ajax request.

@amnesia7
Copy link
Author

I'm not sure if it relates to the issue here with IE8 and 9 or not but when trying to use photon with typeahead.js plugin it required this javascript (https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest) to be called because it needs to do a cross domain request for the json and IE8 and 9 only allow jsonp across domains. This script gets around that but isn't ideal to require an extra resource. @christophlingg it might be worth the ability to pass a &callback=? in the api request so that it returns valid jsonp (the json is wrapped in a javascript function) should it be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants