Good Early Morning (just barely)
I have an issue with a javascript function in <head> portion of a script apparently sending something to the browser that is preventing a redirect from working the way it was before I added this JS...
Here is the JS that I added
<link type="text/css" href="jui/css/le-frog/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
<script type="text/javascript" src="jui/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="jui/js/jquery-ui-1.8.18.custom.min.js"></script>
<script type="text/javascript">
$(function() {
var dates = $( "#from, #to" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 1,
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
});
});
</script>
After that the </head> tag comes, and then the body and a display table, etc...
All of this was working just fine...
In the table there is a comparison of a variable like this:
if ($accept != 'Y'){ // variable set in logcheck
header('Location:../memupdate.php');// if haven't accepted TOS go there
exit;
}
Before the JS code, when $accept wasn't 'Y' then it redirected just fine...
With the JS code, it ignores the redirect and just exits...
What is it in the JS code that would be interpreted as sending something to the browser, which is the only thing I can figure would be happening?
I know it is in that section of js code because if I take that out of the <head> section, the script goes back to working just fine...
Any assistance in this matter would be greatly appreciated.
Douglas
OK, I've narrowed it down even further...
If I take out this portion of the code, then it allows the page to redirect as it should
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );
}
So what is it in that code that would cause the problem???
Any ideas?