weird issue with id string I ran into

weird issue with id string I ran into


Here's a block of codes I got issue with while upgrading from 1.2.6
to 1.3
//this works in both 1.2.6 & 1.3//
if (state==='on') {
        if (!$('#sr_ajax_loader').length) {
            var $sR = $('#search-result-container');
         $('<div id="sr_ajax_loader" />')
             .css({
                 width: $sR.width() + 'px',
                 height: $sR.height() + 'px',
                 top: $sR.offset().top + 'px',
                 left: $sR.offset().left + 'px',
                 opacity: '0.7'
             }).appendTo('#content').fadeIn(); //brings up ajax loading
graphic
        }
    } else {
        $('#sr_ajax_loader').fadeOut(function () { $(this).remove(); });
    }
//this throws error in 1.3 but worked in 1.2.6: uncaught exception:
Syntax error, unrecognized expression: #//
    if (state==='on') {
        if (!$('#get-search-results-ajax-load').length) {
            var $sR = $('#search-result-container');
         $('<div id="get-search-results-ajax-load" />')
             .css({
                 width: $sR.width() + 'px',
                 height: $sR.height() + 'px',
                 top: $sR.offset().top + 'px',
                 left: $sR.offset().left + 'px',
                 opacity: '0.7'
             }).appendTo('#content').fadeIn(); //brings up ajax loading
graphic
        }
    } else {
        $('#get-search-results-ajax-load').fadeOut(function () { $
(this).remove(); });
    }