I'm having a problem with .attr(). I will explain it whith code. I have this HTML code: <p id="textoMarca0" onmouseover="muestraDialog('textoMarca0');"> this is an example paragraph </p> <p id="textoMarca1" onmouseover="muestraDialog('textoMarca1');"> this is another example paragraph </p>
and with Jquery.attr() i set the onmouseover to blank because i want to disable this function in each 'textoMarca'+number element. I do that with this code: var elem = "textoMarca"; var i = 0; while($("#"+elem+i).length) { $("#"+elem+i).attr('onmouseover',' '); i++; }
but now when i click in another button to re-activate the onmouseover it doesn't work again... this is the .click() code of that button: var elem = "textoMarca"; var i = 0; while($("#"+elem+i).length) { $("#"+elem+i).attr('onmouseover','function onmouseover(event) { muestraDialog(" '+elem+i+' "); }'); i++; }
So now the onmouseover has again its value [the original one, copied by doing an alert($("#"+elem+i).attr('onmouseover')) when i disable the onmouseover event], but it doesn't work :( Any suggestion??
I'm having a problem which is that when i do $.get(....., function(data){alert(data);}) in IE the alert show me ALL HTML CODE OF THE PAGE, but in Mozilla show me just what I return in the php funcion... what is wrong? It's possibly that $.get doesn't work in IE... the url is OK, the parameters are OK, so... IE is allways producing me headackes... :( i need help because i don't understand why it works less in IE...
Here is my code: $.get(url, {foovar:foovalue}, function(data) { //in my function (in the php file), which attac the database,if all was right i return the string "alldone" if was wrong i return the error. if(data.indexOf('alldone')!=-1) //ok { alert("\n the insert was done"); $('#nombre_curriculum').val(''); $('#div_results').load("/gestion_clients.html #div_results"); $("#form_add_client").hide(); } else { alert("\n an error has occurred:\n"+data); return false; } }); Thanks.