2012-10-12 2 views
0

리디렉션으로 작동하고 사용자가 라디오 버튼을 클릭 할 때 일부 값을 설정하는 코드가 있습니다. 크롬과 파이어 폭스에서이 스크립트는 IE에서 완벽하게 작동하지만 전혀 발생하지 않습니다.라디오 버튼으로 IE에서 javascript가 작동하지 않습니다 onClick

HTML

<td> 
    <input type='radio' id="order_type6" name='order_type' value="5" 
     onClick="selectOrderType('1')"> 
    <label for="order_type6"><strong>Facility Employee</strong></label> 
</td> 
<td> 
    <input type='radio' id="order_type7" name='order_type' value="5" 
     onClick="selectOrderType('1')"> 
    <label for="order_type7"><strong>Private Contract</strong></label> 
</td> 

JS 기능 :

function selectOrderType(type) 
{ 
    console.log(type); 
    //replace '&load=1' with '&neworder=1' 
    $location = window.location.href.replace(/&load\=1/,'&neworder=1#'); 
    //replace '#' at the end of the string with '' + $ordertype 
    window.location.href = $location.replace(/#?$|&order_type\=\D?/,'&order_type='+type); 
} 
+3

변경되지 않습니다. IE가 열려 있지 않으면 IE는 콘솔을 지원하지 않습니다. – mplungjan

+0

추신 : 두 라디오에서 동일한 유형과 같은 값을 사용하는 점은 무엇입니까? – mplungjan

+0

jsFiddle ftw : http://jsfiddle.net/rudiedirkx/KD7Mn/show/ – Rudie

답변

관련 문제