2010-10-06 9 views
0

Cela fonctionne dans Firefox, mais ne fait rien dans IE:jQuery changer dynamicly onclick location.href

  $("#_results").autocomplete({ 
       source: data, 
       minLength: 0, 
       select: function(event, ui) { 
        $("#log").empty(); 
        log(ui.item.lname + ", " + ui.item.fname + " " + ui.item.sso); 
        log("Currently in " + ui.item.currentRotation + " rotation"); 
        log("Graduated from: " + ui.item.college); 
        log("More details can be viewed by clicking here"); 
        $("#log").attr("onclick", "location.href=\'" + ui.item.dataformEntry + "\'\;"); 
       } 

Plus précisément $("#log").attr("onclick", "location.href=\'" + ui.item.dataformEntry + "\'\;");

Y at-il une autre façon de le faire?

Merci

Répondre

1

avez-vous déjà essayé avec

$("#log").bind("click", function() { 
    location.href = ui.item.dataformEntry 
}); 
3

essayer cette

$("#log").click(function(){ 
    location.href= ui.item.dataformEntry; 
});