Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 906189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:20:48+00:00 2026-05-15T16:20:48+00:00

I am trying to pass a custom response header to notify my javascript the

  • 0

I am trying to pass a custom response header to notify my javascript the user has timed out. It works good expect when it comes to using it with jquery u.i dialogs.

I have this

$.ajaxSetup
({
    complete: function (event, xhr, options)
    {

        if (event.getResponseHeader('X-LOGON') === 'LogOn')
        {

            window.location.href = "redirect to signin";
        }
    }

});

So this should run after every jquery ajax request and it does.

Now I have something like this for my dialog

  $.manageAjax.add('NonCachedAjaxRequests',
    {
        type: "GET",
        url: 'ajaxRequestPath',
        success: function (result)
        {
            $('#Dialog').html(result).dialog(
            {
                width: 580,
                height: 410,
                resizable: false,
                modal: true,
                buttons:
                {
                    Cancel: function ()
                    {
                        $(this).dialog('close');
                    },
                    'Create': function ()
                    {
                        // create;   
                    }
                },
                close: function ()
                {
                    //destroy
                }
            });


        }
    });

    return false;

});

I am using something called ajax manager http://www.protofunc.com/scripts/jquery/ajaxManager/ this just helps with stopping double clicks and stuff like that and uses all the same methods that $.ajax would use.

So now when I look at the request coming back to populate the above dialog box I see this in firebug

Response Headersview source
Server  ASP.NET Development Server/10.0.0.0
Date    Fri, 02 Jul 2010 22:12:36 GMT
X-AspNet-Version    4.0.30319
X-AspNetMvc-Version 2.0
X-LOGON LogOn
Cache-Control   private
Content-Type    text/html; charset=utf-8
Content-Length  6468
Connection  Close

Notice how it says “X-LOGON” but when it comes to my ajaxSetup and gets to

if (event.getResponseHeader('X-LOGON') === 'LogOn')

it always says it is null but as you can clearly see firebug is saying otherwise. I don’t understand whats is going on.

Edit

Ok it seems to be a problem with ajax manager. I really want to keep using it or something comparable as it really helps out with stopping duplicate requests.

What I found out is that it does not like global ajaxSetups I don’t know why it just does not like them. I started to try to use status codes instead so I been playing around with “403” and found this.

if an ajax request 403’s out and your using ajaxSetup with complete and ajaxmanager it will still try to go into the success message one.

If you put an ajax complete before the success one(it does not work if complete is after success) and it comes back with 403 then ajax manager has no problem acting on it and hitting the complete.

So I am not sure what to do. I want to use ajaxmanager or something like it and I want to use ajaxSetup.

So I don’t know if I can have both at this moment though.

Edit 2

When I use status codes and ajaxSetup with ajax manager I get this error

error: status: 403 | URL:
/MyURL
http://localhost:3086/Plugins/AjaxManager/Source/jquery.ajaxmanager.js
Line 44

 error: function(ahr, status){
36 var opts = this;
37 if(status && status.indexOf('error') != -1){
38 setTimeout(function(){
39 var errStr = status +': ';
40 if(ahr.status){
41 errStr += 'status: '+ ahr.status +' | ';
42 }
43 errStr += 'URL: '+ opts.url;
44 throw new Error(errStr);
45 }, 1);
46 }
47 }, 

so I don’t know if this is another reason why I am getting an error.

Edit 4

Seems like I been using a version that apparently is not compatable for version 1.4(not sure why it worked)

Anyways I am using 3.0 now it still does not work but it has some new options that I would like to try but have no clue how to use them.

http://www.protofunc.com/scripts/jquery/ajaxManager3/

If you look at the events/callbacks it’s got some global complete so maybe that might be what I need. Have no clue how to run it though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:20:48+00:00Added an answer on May 15, 2026 at 4:20 pm

    the source code of manageAjax is available here:
    http://www.protofunc.com/scripts/jquery/ajaxManager/jquery.ajaxmanager.js

    The global jquery ‘complete’ function is sent via those line :

    if (opts.global) {
        $.event.trigger("ajaxComplete", args);
    }
    

    This creates a new Event object on the fly so it blanks out any data you may have available on the original event.

    I might be wrong, but after reading the code quickly, the headers are lost early in manageAjax and I am not sure you can do what you want while using this library until the library gets patched to allow this.

    So Roberto’s comment seems like a good advice : try it without manageAjax and it will most probably work

    I hope this will help you,

    Jerome Wagner

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 474k
  • Answers 474k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What I would do is display your game in the… May 16, 2026 at 4:24 am
  • Editorial Team
    Editorial Team added an answer The cleanest way is to do SchemaExport.Drop with the old… May 16, 2026 at 4:24 am
  • Editorial Team
    Editorial Team added an answer You need to change the ProviderManifestToken inside your EDMX to… May 16, 2026 at 4:24 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.