2016-03-15 36 views
-2

我想在原始功能中的点击完成后接听回电。在jquery或javascript或角度单击单选按钮或复选框后返回调用

<input type="radio" onchange="changefun()" /> 
function changefun() 
{ 
    // some code will be done here 
} 

其他页面

$(document).on('input:radio','click',function(e){ 
    // success means after the changefun() has completed 
    if(e.success) 
    { 
     // some code 
    }else{ 
     // some code 
    } 
} 

上我们有jQuery中

+3

如何是有关angularjs这个问题? –

+0

为什么不叫'输入:收音机','点击'....处理程序在变化结束时?如果你需要参考变量这里面它可以使用调用,应用。 –

+0

如果我们有任何与角度有关的东西也没问题,那就是为什么增加角度 – SrinivasNaidu

回答

0

像这样的东西,我希望这将有助于解决您的问题。让我知道。

function changefun() { 
 
    alert("Change Called"); 
 
} 
 
       
 
$(document).ready(function(){ 
 
    $('input[type="radio"]').click(function(e){ 
 
    
 
    if ($(this).is(':checked')) 
 
    { 
 
     alert("Success"); 
 
    } 
 
    else 
 
     { 
 
     alert("Fail"); 
 
     } 
 
    }); 
 
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 
 
<html> 
 
    <body> 
 
<input type="radio" onchange="changefun1()" >Select</input> 
 
</body> 
 
</html>

+0

不是我的要求,一旦函数被调用需要回应文档点击 – SrinivasNaidu

+0

编辑的代码是你期待的吗? – ViKu

+0

一旦changeFun已经完成,我需要再次调用$ document click事件 – SrinivasNaidu

相关问题