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

IE9 Nightmare #141

Closed
erswelljustin opened this issue Mar 18, 2014 · 14 comments
Closed

IE9 Nightmare #141

erswelljustin opened this issue Mar 18, 2014 · 14 comments

Comments

@erswelljustin
Copy link

I have tested in almost every other browser and everything is fine and dandy however when I test in in IE9, nothing, I mean nothing no errors coming through and the script is firing I think as my callback->remote_filter logs are displaying

$('#postEntry').atwho({
   at: "@", 
   tpl: "<li data-value='@${name}'><img src='${avatar}' height='20' width='20'/> ${name} </li>", 
  data: "/webAPI/getSearchPostUserKeyword/7", 
  limit: 10, 
  insert_tpl: "<user class='userHighlight' id='user://${id}'>${name}</user>",
  'callbacks': {
      filter: function (query, data, search_key) {
              console.log(data);
              return this.call_default("filter", query, data, search_key);
      }
   }                    
})

Is there something obvious here?

@ichord
Copy link
Owner

ichord commented Mar 19, 2014

oh. I afraid i have to spend some time to find a IE 9 browser case i don't have a windows.

Actually, IE 9 have a dev tool can help you to debug. you can set some interrupt point to see which step is not working.
or, subscribe some events such as $('#postEntry').on('show.atwho', function(ev){console.log(...)}) .

@erswelljustin
Copy link
Author

I think it has something to do with getting data from a remote source i.e. data: '/api/users/7' this is working in IE10 and other browsers but not IE9

@ichord
Copy link
Owner

ichord commented Mar 19, 2014

@erswelljustin this is what At.js do while data is a string (in Model.coffee)

  # load data from local or remote with callback
  #
  # @param data [Array|String] data to load.
  _load: (data) ->
    if typeof data is "string"
      $.ajax(data, dataType: "json").done (data) => this.save(data)
    else
      this.save data

it just use jQuery's ajax method. if you could, take a look at this.

@erswelljustin
Copy link
Author

Sorry, do I have to have the coffee files included?

@ichord
Copy link
Owner

ichord commented Mar 19, 2014

oh. no. my bad. just in jquery.atwho.js and the Model class:

  Model.prototype._load = function(data) {
    if (typeof data === "string") {
      return $.ajax(data, {
        dataType: "json"
      }).done((function(_this) {
        return function(data) {
          return _this.save(data);
        };
      })(this));
    } else {
      return this.save(data);
    }
  };

@erswelljustin
Copy link
Author

Thanks @ichord could you show an example in gist perhaps of how, I am a little confused, sorry & thanks!

@ichord
Copy link
Owner

ichord commented Mar 19, 2014

i have just had a try on IE 9, and it work fine.

And i think that i'm not explain clearly. What i means is just to put some console.log(data) to that _load method to check if there is returning a valid data from remote.

@ichord
Copy link
Owner

ichord commented Mar 19, 2014

BTW. this is some tips how i debug in IE 9

https://gist.github.com/ichord/017578df15972abb2620

@erswelljustin
Copy link
Author

ok so I did as you suggested but I cannot see an issue, sorry about this but its really frustrating as I don't normally support IE in my developments
screen shot 2014-03-19 at 14 38 36

@ichord
Copy link
Owner

ichord commented Mar 19, 2014

oh..... i'm sorry and i really want to help. But it's so difficult that your website is blocked by GFW and i try to setup a VNP on a windows machine. but it not work well.

may be you can do this to see if IE8 's json parser is the same with others.

  Model.prototype._load = function(data) {
    if (typeof data === "string") {
      return $.ajax(data, {
        dataType: "json"
      }).done((function(_this) {
        return function(data) {
          console.log(data); // set a interrupt point here.
          return _this.save(data);
        };
      })(this));
    } else {
      return this.save(data);
    }
  };

@erswelljustin
Copy link
Author

I Understand mate, you are being really great so far so thanks for that, I am getting a LOG: undefined with that change

@ichord
Copy link
Owner

ichord commented Mar 19, 2014

oh. great.
BTW. i just remember that it not work well while inserting DOM in contentEditable model in IE 8.
And I really don't want to struggle with it. = =

check out readme....
screen shot 2014-03-19 at 11 41 31 pm

@erswelljustin
Copy link
Author

I did read the readme and because I am supporting IE9, which is the problem, and up I proceeded, this is not being used in IE8, I Promise ;)

@ichord
Copy link
Owner

ichord commented Mar 20, 2014

i get little confuse. 😄

@ichord ichord closed this as completed Mar 25, 2014
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