I have defined a JavaScript function in the head section of an ASPX page:
<script type="text/javascript" >
function bdScheduler() {
var CanRun = '<%= ScheduleCheck() %>';
if ('Success' == CanRun) {
bcal = window.open('ProjSchedBckwdCalc.aspx?po_rec=<%= lblpodate_R.Text %>', '', 'width=650px, height=750px');
} else {
alert(CanRun);
}
}
</script>
The ScheduleCheck()
function is defined in the code behind and it properly checks dependencies to determine if the page 'ProjSchedBckwdCalc.aspx' can execute its task. If the result is 'Success', a popup window is opened with a value from a label on the current page. Otherwise, an alert displays the message returned by ScheduleCheck()
.
I am triggering this function from the onclick event of a regular anchor tag:
<a href="#" onclick="bdScheduler();" >Backward Scheduler</a>
This code works fine for me in the latest versions of Firefox, Chrome, and IE, but some users are reporting that the button does not work. After investigating, I found out that they are all using Chrome (same version as my test machine), and the browser console shows that bdScheduler()
is not recognized.
My question has two parts: Why are certain installations of Chrome handling this differently even though they are identical builds, and what changes can be made to ensure consistent behavior and proper execution of the desired function?
EDIT: Rendered code:
function bdScheduler() {
var CanRun = 'Success';
if ('Success' == CanRun) {
bcal = window.open('ProjSchedBckwdCalc.aspx?po_rec=12/23/2013', '', 'width=650px, height=750px');
} else {
alert(CanRun);
}
}