简体   繁体   中英

Javascript Code fails in Mozilla Firefox

function getSelectedRadio(seeker_provider) {
  var sign;
  for (var i=0; i<seeker_provider.length; i++) {
    if (seeker_provider[i].checked)
    {
      sign=i;
    }
  }
  if(sign==0)
  {
    alert(sign);
    window.location='updatcty.php';
  }
  if(sign==1)
  {
    alert(sign);
    window.location='../registration_provider.php?proid=2222221 & pagname=select';
  }
  // alert(document.all.seeker_provider.value);
}

I wrote this JavaScript function for getting the selected radio button value and redirect accordingly, but it supports all browsers except Firefox 3.0.6. What can I do?

Try changing this line:

window.location='../registration_provider.php?proid=2222221 & pagname=select';

to this:

window.location='../registration_provider.php?proid=2222221&amp;pagname=select';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM