0

 <input type="radio" id="radio1" name="radio"><label for="radio1">Choice1</label>
 <input type="radio" id="radio2" name="radio" checked="checked"><label for="radio2">Choice2</label>
<input type="radio" id="radio3" name="radio"><label for="radio3">Choice3</label>
</div>
<?php
//     if (radio == Choice1){
//     include ("file1.php");
//     }
//     elseif (radio == Choice2){
//     include ("file2.php");
//     }
//     else {
//     include ("file3.php");
//     }
?>

当我选择“jQuery UI 单选按钮”时,我想“包含”一个页面。请用一个小脚本告诉我。我不是 jquery 或 ajax 专家

4

1 回答 1

0

最好的方法是click在你的收音机上捕捉事件。

然后检查它是否被选中

如果是这样,请通过 ajax 加载您的内容,即

就像是:

$('input[name=radio]').each(function(){ 
    $(this).bind('click', function(){ 
... checking and ajax loading ... 
    });
});

这里有一些链接:

于 2013-05-01T11:06:01.617 回答