1
Vote

Some samples don't work in Firefox

description

E.g. http://localhost:64204/AjaxPatternsDemo/Code/Ajax40/Templates.aspx
 
Neither button "Start monitor" nor "Refresh" update grid below in Firefox.
 
I had to do a minor change to make it work in IE , otherwise it failed with Javascript error.
There was no assignment initially to dv in pageLoad which resulted in exception in getLiveQuotes
 
<script type="text/javascript"> var timer = null; var dv = null; function pageLoad() { if (timer === null) { timer = new Samples.Components.Timer(5000, getLiveQuotes, true); }   dv = $create(Sys.UI.DataView, { serviceUri: "/ajaxpatternsdemo/LiveQuotes.svc", query: "GetQuotesFromConfigOffline" }, {}, {}, $get("grid") );   } </script>

comments

micmit wrote Apr 29, 2009 at 2:55 AM

It turned out
function getLiveQuotes()
    {

       var isOffline = $get("<%= chkOffline.UniqueID %>").checked; 
...
results in

var isOffline = $get("ctl00$PH_Body$chkOffline").checked;

which quite rightly upsets Firefox
as checkbox comes as

<input id="ctl00_PH_Body_chkOffline" type="checkbox" checked="checked" name="ctl00$PH_Body$chkOffline"/>
<label for="ctl00_PH_Body_chkOffline">Offline</label>

but

var isOffline = $get("<%= chkOffline.ClientID %>").checked;

does result in proper ID on a client

var isOffline = $get("ctl00_PH_Body_chkOffline").checked;

wrote Feb 13, 2013 at 1:23 AM