Skip to content

Expose XHR - Intercept remote calls. #46

Open
@awgeorge

Description

@awgeorge

It seems like this plugin is locked down. Its a shame that twitter didn't allow for customisation.

I am now finding very difficult to intercept the XHR request. The typeahead sometimes responds with 401 if your session has timed out. I would like to intercept it and return the user to the login screen.

I have tried:

$(document).ajaxComplete(function(event, xhr) {
        if(xhr.status == 401){
            window.location.reload();
        }
    });

.bind('typeahead:asyncreceive', function(event , a ,b){
        //none of these vars are useful. - event object doesn't seem to contain the XHR

    });

I have also tried numerous settings in bloodhound / typeahead, but these appear to have been phased out:
twitter/typeahead.js#1029
http://stackoverflow.com/questions/23985898/twitter-typeahead-bloodhound-reutilization-how-do-i-show-a-loading-gif-for-th

Starting to wish I picked a different library :/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions