开发者

jquery not working in internet explorer using mvc

i have a group of radio buttons that are generated on the fly from the db into a partial control then rendered on the page as html and they all have the same name now in firefox and chrome the following code works fine

$(".Fligh开发者_运维知识库tSelectedRadio").live('click', function() {
    alert("after flight select");
    $("#ToisGarantueedBid").attr("disabled", false);
});

however in ie it doesnt work on the first select of a radio but only fires if u select something else ? any ideas wat the problem is ?


Lazarus, is right! The code you are writing should be executed after JQuery's page ready event fires which can be accomplished in two ways.

1) Like Lazarus

$(function() { 
     // your code here.
});

2) Or tying in to the document object ready event.

$(document).ready(
   function() {
       // your code here.
   }
);


yeah the radios are getting populated by jquery ajax call, i have managed to get it to work by using the change function isntead thanks for the help

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜