Welcome Guest, Not a member yet? Register   Sign In
Problem with AJAX and IE
#1

[eluser]Justin Patel[/eluser]
Hello,

I am using Ajax for fetching data after every 5 seconds, Its working fine for Fire fox, but IE shows the old data .........


Any fix for this..........


Plz help.....

Thanks,
Justin
#2

[eluser]xwero[/eluser]
Ah yes the IE cache problem. It's a known problem which can be avoided by adding a timestamp to the url. That makes IE believe it's calling another page every time.
#3

[eluser]Justin Patel[/eluser]
How to add time stamp to url ? can you plz tell us some example
#4

[eluser]Justin Patel[/eluser]
I have one more little problem , My session got expire in few seconds, I am trying to keep session but it expire after next page ...............



plz plz help me I have stuck here from last 2 days
#5

[eluser]Justin Patel[/eluser]
Thanks the problem with IE has been fixed
#6

[eluser]xwero[/eluser]
If you are using jQuery and you have for example this javascript code
Code:
$.ajax({
   type: "POST",
   url: "index.php/ajax/method",
   data: "name=John&location=Boston",
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
});
You can change is to
Code:
var d = new Date();
$.ajax({
   type: "POST",
   url: "index.php/ajax/method/"+d.getTime(),
   data: "name=John&location=Boston",
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
});

About the session problem. If you access an url via ajax it has another session id so what you can do is store the session id in the database add it to javascript as a variable
Code:
var sessionid = <?php echo session_id(); ?>
Post it along with your other post data and compare it with the session id from the database. If you are using the CI session library you have to echo
Code:
$this->session->userdata('session_id');
#7

[eluser]Justin Patel[/eluser]
Thanks for your reply


The thing is.....


fire fox save the session

but IE does not

I dont know why it has this problem

let me show you live example

try to access : music.globalprompt.net

click on music or movie link on top

then you will have login box



try to login using user name : globalprompt and pass : globalprompt

Fire fox keep the session but IE does not

Please help I have stuck her form many days

Thanks
#8

[eluser]Justin Patel[/eluser]
It always get logged out in IE
#9

[eluser]Justin Patel[/eluser]
Is that problem of IE or its a problem of CI??




Theme © iAndrew 2016 - Forum software by © MyBB