I am throughly confused....why does this seemingly simple deal not work?
<script type="text/javascript">
<!--
window.onbeforeunload = function (){
var checkboxImg = new Image();
var checkboxImgUrl = "checkbox.php%3Flonger%3D" + reviews-chk-longer.checked +
"%26discrete%3D" + reviews-chk-discrete.checked +
"%26natural%3D" + reviews-chk-natural.checked +
"%26thicker%3D" + reviews-chk-thicker.checked +
"%26permanent%3D" + reviews-chk-permanent.checked +
"%26stamina%3D" + reviews-chk-stamina.checked +
"%26harder%3D" + reviews-chk-harder.checked +
"%26vascularity%3D" + reviews-chk-vascularity.checked +
"%26drive%3D" + reviews-chk-drive.checked +
"%26guarantee%3D" + reviews-chk-guarantee.checked +
"%26trials%3D" + reviews-chk-trials.checked +
"%26affordable%3D" + reviews-chk-affordable.checked;
alert(checkboxImgUrl);
checkboxImg.src = checkboxImgUrl;
}
// -->
</script>
I get no alert when I do this....the same thing without all of the added strings works fine, ie:
<script type="text/javascript">
<!--
window.onbeforeunload = function (){
var checkboxImg = new Image();
var checkboxImgUrl = "checkbox.php";
alert(checkboxImgUrl);
checkboxImg.src = checkboxImgUrl;
}
// -->
</script>
The alert pops just fine....what is up??? What am I missing?
I tried .concat the strings too...still same thing is happening...why?