Henry
Henry

Reputation: 883

AJAX callback failing in Firefox

The page contains accordion control which expands and contract on clicks. When it expands, it's supposed to show the records from the database. It works fine when I first open the page. But it fails on refresh. This working fine in IE, Its the problem with Firefox only. On Refresh its failing in Firefox. I tried giving "hPanelLoaded" a value of "FALSE" on page load. Still its notworking. It seems on refresh FF is not able to get the value of "hPanelLoaded" and it says "$("hPanelLoaded") is null".

here is the Page structure. MainPage.aspx is calling Control > hPanelLoaded.ascx is calling > hPanelLoaded.js.

Any idea what mistake I am doing.

Here is the code

@@@@@@@@@@ this is in hPanelLoaded.ascx. @@@@@@@@@@@

<input type="hidden" id="hPanelLoaded" />     

@@@@@@@@@@ this is in hPanelLoaded.js. @@@@@@@@@@@

function loadPanel1() {
    try {
        if ($('hPanelLoaded').value != 'TRUE') {
            grdarts.callback();
            $('hPanelLoaded').value = 'TRUE'
        }
     // else {
              //  alert('INSIDE ELSE');
              //  $('hPanelLoaded').value = 'FALSE';
           // }
    }

Upvotes: 0

Views: 110

Answers (1)

MrOBrian
MrOBrian

Reputation: 2189

Your selector should be

$('#hPanelLoaded')

since you are selecting by id (note the addition of the #)

Upvotes: 5

Related Questions