Ugh.The type attribute is required.This has been unnecessary for a long time: while there are some browsers left that don't do Javascript, they all at least know enough to ignore it.day hasn't been declared, so you're unnecessarily making it global; the same applies to id. It also seems kind of pointless to store the window if you're not going to do anything with it.
Code:
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=270,height=110,left = 595,top = 325');");
eval() is very ugly and very rarely required. Here, for example, one would use an array. If, for some reason that doesn't apply here, you really wished to create individual global variables, you could access them as window[nameOfVariable]; for example,
Code:
window["page" + id] = window.open( ... );
Code:
<script type="text/javascript">
var pages = [];
function popUp(URL) {
var opts =
"toolbar=0," +
"scrollbars=0," +
"statusbar=0," +
"menubar=0," +
"resizable=0," +
"width=270," +
"height=110," +
"left=595," +
"top=325";
pages.push(
window.open(URL,
"win" + pages.length,
opts
)
);
}
</script>
You can change the title of the window with document.title, at least if the page is on the same domain.
Code:
var pages = [];
function popUp(url, title) {
var opts =
"toolbar=0," +
"scrollbars=0," +
"statusbar=0," +
"menubar=0," +
"resizable=0," +
"width=270," +
"height=110," +
"left=595," +
"top=325";
pages.push(
window.open(url,
"win" + pages.length,
opts
)
);
pages[pages.length - 1].document.title = title;
}
Bookmarks