UPDATE: Apparently I know crap about CSS, ids should not start with a number. But browsers besides firefox 3.6 allow it.
Chrome 10.0 and Firefox 3.6.16 on Linux. Clicking ajaxLink in firefox does nothing at all. Using firebug I can see no ajax request is being generated.
Here is the html generated by using ajaxLink. it works in everything except Firefox 3.6:
jQuery('body').undelegate('#4db0afb7cd6c8','click').delegate('#4db0afb7cd6c8','click',function(){jQuery.ajax({'success':function(data){ if (data) { $('#viewuser').html(data); $('#viewuser').show('fast'); } },'url':'/~user/kt/index.php?r=UserGroup/userViewForm&id=109','cache':false});return false;});
<a href="#" id="4db0afb7cd6c8">newuser</a>
It turns out this html works though, for firefox and chrome. But doesn’t use ajaxLink at all:
<a onclick="jQuery.ajax({'url':'index.php?r=UserGroup/userViewForm&id=109','cache':false,'success':function(html){jQuery('#viewuser').html(html); jQuery('#viewuser').show('fast') }});return false;" href="#">newuser</a>
Here is the php code:
Does not work in Firefox, works in Chrome:
<?php
echo CHtml::ajaxLink(
CHtml::encode($name),
array('UserGroup/userViewForm', 'id' => $id),
array(
"success"=>"function(data){ if (data) { $('#viewuser').html(data); $('#viewuser').show('fast'); } }",
),
array('id' => uniqid())
);
?>
Works in Firefox and Chrome:
<a href="#" onclick="jQuery.ajax({'url':'index.php?r=UserGroup/userViewForm&id=<?php echo $id; ?>','cache':false,'success':function(html){jQuery('#viewuser').html(html); jQuery('#viewuser').show('fast') }});return false;"><?php echo CHtml::encode($name); ?></a>
Anyone know why this would be? The problem I’m having is not just with ajaxLink but also running ajax though items like dropDownList. Works in Chrome, not in FF.
I booted up a Windows machine and the code works in IE 7, Firefox 4, but not Firefox 3.6! What the heck!