Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder nexosis's Avatar
    Join Date
    Dec 2006
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ajax: stop and continue redirect

    How do we stop and continue redirecting? example is when logging in codingforums.

    Is this possible with AJAX?

    progress: HTML: 100% > CSS: 90% > Javascript: 55% > Php:10%
    Want an avatar like mine? it's free! just pm me.

  • #2
    New Coder
    Join Date
    Mar 2007
    Location
    italy
    Posts
    94
    Thanks
    1
    Thanked 1 Time in 1 Post
    Quote Originally Posted by nexosis View Post
    How do we stop and continue redirecting? example is when logging in codingforums.

    Is this possible with AJAX?
    login of codingforums is without AJAX:
    you're in page A, compile the form with your usern and passw, press submit.
    so you're redirected to page B, which checks for your authentication. if succeeds, wait a few seconds and then send you back to A. if not, it gives you an error etc...
    it's something like this:
    Code:
    	if authentication == OK
    	then
    		<script>
    			function doRedirect() {
    				location.href = "the page where you come from";
    			}
    
    			window.setTimeout("doRedirect()", 4000);
    		</script>
    	else
    		go to error page
    		etc..
    with AJAX:
    you are on page A, you compile the form and press submit, AJAX with Javascript contacts the server and look if you can be authenticated or not, and then tells you, always staying on page A.

    so, the example you asked for is without AJAX


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •