Welcome Guest, Not a member yet? Register   Sign In
URI Problem with Ajax and jQuery
#1

[eluser]Devyn[/eluser]
Hi,
Let's say I have 2 Controller (server and game). I show server list with controller 'server/index' which call multiple view. I check with jQuery every 3 seconds if both players are ready to play.
Code:
if(data == 1){`window`.`location`.replace('redirect_to_game/'+server_id);}
'redirect_to_game' is a method of Server Controller which will redirect to 'Game Controller's index page'
Code:
function redirect_to_game($server_id){
        redirect('game/index/'.$server_id,'refresh');
    }
Everything is working as excepted until both players are get ready so they are redirected to 'Game's Index Page'. The problem starts here. After redirected to 'Game/index' and I called 'Server/index' again but this time, methods used in jQuery codes lost 'parent controller'.
I mean above
Code:
redirect_to_game
is calling to http://localhost/codeigniter/redirect_to_game so everything messed up.
If i add parent controller like this,
Code:
if(data == 1){`window`.`location`.replace('server/redirect_to_game/'+server_id);}
it is calling like this http://localhost/codeigniter/server/serv...ct_to_game before both players are ready. What should I do?


Messages In This Thread
URI Problem with Ajax and jQuery - by El Forum - 04-28-2010, 10:38 AM
URI Problem with Ajax and jQuery - by El Forum - 04-28-2010, 06:16 PM
URI Problem with Ajax and jQuery - by El Forum - 04-28-2010, 08:26 PM
URI Problem with Ajax and jQuery - by El Forum - 04-28-2010, 09:36 PM
URI Problem with Ajax and jQuery - by El Forum - 04-28-2010, 09:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB