|
Posted by McKirahan on 09/20/05 00:56
<gleverett@gmail.com> wrote in message
news:1127160660.056969.64100@g43g2000cwa.googlegroups.com...
> I have been searching the 'Net, and I can't find the right solution
> here. I am writing some PHP pages that utilize some Javascript. The
> script works in Mozilla/Netscape, but fails in IE. I don't know if
> it's the Javascript or the PHP that is causing the problem. I started
> with an example in a book and added on.
>
> The script I'm using is:
>
> <SCRIPT LANGUAGE="Javascript" TYPE="text/javascript">
> <!--
> function open_window(url) {
> var NEW_WIN = null;
> NEW_WIN = window.open ("", "Record Viewer", "toolbar=no,width=<?php
> echo $new_win_width ?>,height=<?php echo new_win_height
> ?>,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no");
> NEW_WIN.location.href = url;
> }
>
> //-->
> </SCRIPT>
>
> (I added some line break to make it readable The NEW_WIN line is all
> on one line.)
>
> The PHP variables get added correctly, and the two calls from the PHP
> program are similar to:
>
> <a
> href="javascript:open_window('$PHP_SELF?action=action1');\">Action1</a>
>
> or an
>
> echo "<button
> onClick=\"javascript:open_window('$PHP_SELF?action=insert_record');\" >
> Insert new record</button>";
>
> These work fine in Netscape/Mozilla, but in IE, after clickng a bunch
> of times, I get "Domain not found". I've replaced PHP_SELF with the
> full URL to test, and it still fails. I know that the scripting is
> turned on in IE becuase I can go to example sites and the window.open
> function works.
>
> Any ideas as to what's going on here?
I tested with this variation:
<html>
<head>
<title>js_php.htm</title>
<script type="text/javascript">
function open_window(url) {
var cfg = "width=<?php echo $new_win_width ?>,"
cfg += "height=<?php echo new_win_height ?>,";
cfg += "scrollbars=yes,resizable=yes"
var win = window.open ("","Record Viewer",cfg);
win.location.href = url;
}
</script>
</head>
<body onload="open_window('http://www.google.com/')">
</body>
</html>
and it didn't work for me under IE (5.5) either.
My guess is that IE doesn't interpret inline php.
Navigation:
[Reply to this message]
|