$.ajax and the same domain
Hello everybody,
I have a little issue with the use of jQuery and a call with the method Ajax.
The problem appears with IE7 when I call just after the page was loaded. If I wait 2/3secondes, I don't have this beautiful message :
My call ajax process to the same domain that the source page. I call the function when the DOM is loaded with the function $(document).ready();
That's my code :
- $(document).ready(
- function()
- {
- if($('#no_result').length){
- }else {
-
- var timer;
-
- $("#tabCollab tbody tr[id!=tabEntete]").hover(
-
- function()
- {
- var number = $(this).find("span[id*='number']").html();
-
- timer=setTimeout(function(){
- //ajout du loading
- $('#infos_utiles').html('<p id="loading" align="center"><img src="'+ROOT_URL+'/images/common/loading.gif" /></p>');
-
- $.ajax({
- type: "POST",
- url: ROOT_URL+"/ajax/collabgetinfos/"+(Math.random()*99999),
- cache: false,
- data: {use_number:number},
- dataType : "json",
- success: function(data){
- $('#loading').remove();
- obj = window.eval(data);
-
- $('#infos_utiles').prepend("<ul><li>Projets : <span id='infos_projets'></span></li><li>Compétences majeures : <span id='infos_competences'></span></li></ul>");
- // Update des projets
- if(obj.projets){
- var listeProjets = obj.projets.join(',');
- $('#infos_projets').prepend("<span>"+listeProjets+"</span>");
- }
- else
- $('#infos_projets').html("Aucun");
- },
- error : function(data){
- $('#loading').remove();
- $('#infos_utiles').prepend("<p>Une erreur est survenue lors de la requête. Veuillez recharger la page.</p>");
- }
- });
- },1500);
-
- },
- function()
- {
- clearTimeout(timer);
- }
- )
- }
- });
The method was called approx. 1,5seconde after the mouse is over a cell of the table. The options are cache:false and I add a generated number after the URL to have an unique URL.
On Google Chrome, it's works. On IE, that's works only if i wait 3secondes forward the call.
.
Someone can help me ?
Thanks
Louis
ps : sorry for my english