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?
This is a repost of (http://www.daniweb.com/forums/post1247153.html#post1247153) because I couldn't get anyone to help me there...because I started posting stuff there to try to get it to the top...and in the end no one helped me.