Avoid ajax redirection

pudz

New Member
Thank you for taking of your time to help me out.Even though I sure can't be the first one having this problem, I couldn't find any good answer so far so there it goes.Let's say I have two ASP (classic) pages.Target1.asp which redirects to Target2.asp with response.redirect(url)Now, I have to GET Target1.asp using async methods and you might have already figured out I am using AJAX to do so. Problem is when I use $.ajax('method':'GET', [...]) or simply $.get('Target1.asp') and have the 'complete' callback fill a div with response content, it redirects the whole page to Target2.asp instead of filling the div. The reason is quite simple: the div is indeed filled with content of Target1.asp. The browser still has to redirect and since a div is not like an iframe at all, the entire page is redirected.I am almost sure you cannot control redirections directly from javascript (?). Is there a way of handling this problem without making use of iframes?This is what I am trying to do:Request Target1.asp with GET method using ajax, handle redirection (or something similar) so that ajax requests Target2.asp AND THEN fill the div with the final result.Thank you.EARLY EDIT : If you need a coded example, I can write one.
 
Top