Hi. I'm new to JQuery. We have a system that dynamically generates pages from the database. The users want some of the pages changed. I'm trying to use JQuery to modify the pages on the fly so I don't have to mess with the vendor's code. below is my code as I'm just starting out. It works perfectly for Firefox and Chrome, however, none of the changes appear in IE. I don't know where to start debugging this thing. Please help.
$(document).ready(function() { /********************************************************************* * Mods that Apply to All Pages * *********************************************************************/ // remove the Not Reported radio buttons //--------------------------------------- $('input[id*=NOT_REPORTED]').each(function(){ var $thisButton = $(this); // copy everything except the text nodes var $nodeKids = $thisButton.parent().children(); // then paste again overwriting everything including text nodes $thisButton.parent().html($nodeKids); // replace the text nodes $thisButton.parent().children('label:nth(0)').before(' Yes '); $thisButton.parent().children('label:nth(1)').before(' No '); // remove the buttons $thisButton.next().remove(); $thisButton.remove(); }); // remove the No Response radio buttons //--------------------------------------- $('input[id*=notrep_id]').each(function(){ var $thisButton = $(this); // copy everything except the plaintext nodes var $nodeKids = $thisButton.parent().children(); // then paste again overwriting everything including text nodes $thisButton.parent().html($nodeKids); // replace text nodes $thisButton.parent().children('label:nth(0)').before(' Yes '); $thisButton.parent().children('label:nth(1)').before(' No '); // remove the buttons $thisButton.next().remove(); $thisButton.remove(); }); /********************************************************************* * Page Specific Modifications * *********************************************************************/ switch ($('title').text()) { // bwskaper.P_DispAppPersonal case 'Personal Information': { // remove the (xxxxxxxxxxxxxxx) from the SS label $('acron...@title=nine digit format]').remove(); break; } // bwskwpro.P_WebProspectMain case 'Inquiry Form': { // remove prefix field row $('#prefix_id').parent().remove(); // remove suffix field row $('#suf_id').parent().remove(); // remove nickname field row $('#nick_id').parent().remove(); // remove "valid from" and "valid until" rows $('td[id*=vf_id]').parent().remove(); $('td[id*=vu_id]').parent().remove(); // remove county rows $('td[id*=cnty_id]').parent().remove(); // remove the Int'l Access Code rows $('input[name*=ext_in]').remove(); // replace 'xxx' labels for telephone fields with something that makes sense $('input[id*=pn_id]').each(function(){ var $thisField = $(this); var $nodeKids = $thisField.parent().children(); $thisField.parent().html($nodeKids); $thisField.parent().children('input:last-child').after(' 555-1234567'); }); // remove the extension fields (remove the entire row) $('td[id*=iac_id]').parent().remove(); // change 'Nation' label to 'Country' $('td[id*=natn_id]').text('Country:'); // baseline "How I Learned" label has a bug, replace content $('#hil_id').text('How I Learned About Biola University'); } } }); // end $(document).ready()