please tell me what is wrong in this code? this does not put a popup when i place this code in php.. but if the same code is in a html file then i can see the popup coming <?php echo '<SCRIPT LANGUAGE="JavaScript"><!-- Begin window.open ("http://google.com","mywindow") // End --></script>'; ?> Code (markup):
Try this: <?php echo "<SCRIPT LANGUAGE=\"JavaScript\"><!-- Begin window.open (\"http://google.com\",\"mywindow\") // End --></script>"; ?>
I doubt there would be a problems in the quotes. If you have a JS debugger / console installed (using Firefox?) then you would have a better idea. I'm going to take a stab in the dark and say it's because your 'Begin' is not commented out. Try: <?php echo '<SCRIPT LANGUAGE="JavaScript"><!-- // Begin window.open ("http://google.com","mywindow") // End --></script>'; ?> or even just: <?php echo '<SCRIPT LANGUAGE="JavaScript"><!-- window.open ("http://google.com","mywindow") --></script>'; ?>
ok thanks a lot.. i tried the original script again and it seemed to work dont know what was the problem that time.. adding reps to u both..