Menu
This might be kindergarten stuff…
I have a document that I want to always open in a window of a certain size, without any toolbar, menubar, locationbar. I found some PHP reference material about DOM, but I can’t make head or tail of it.
Like for example, can I put code right into the document, before any HTML output, that controls those properties? Or do I have to put code in the previous document that opens and configures the window, then opens the document? Can someone get me started?
In other words, I put the window.open method straight into the onclick event argument of an <a> element, without calling a javascript function[/QUOTE]Sorry to disappoint you but that is javascript.
Maybe I'm missing the point of what you're trying to do. But, could you just use an iframe tag? It's just a simple HTML tag. You can place it anywhere within your document, specify the size, border type, whether or not you want scroll bars, etc. Is this what you are trying to accomplish?[/QUOTE]
What I want is a new window, without any toolbar, status bar, or location bar, and a close button.[/QUOTE]Then you need javascript.
Sorry to disappoint you but that is javascript.[/QUOTE]
that will remove the toolbar and locationbar from the document's current window.[/QUOTE]Most people adjust their browser as they like it and don't look favourably on websites that make changes especially without permission. Infact it is precisely this type of terrorist tactic that has created javascript's bad reputation.
this type of terrorist tactic [/QUOTE]
[code=html]<a href="http://www.google.com/" onclick="window.open(this.href, '_blank'); return false;">link</a>[/code]
this will work regardless of js enabled or not[code=html]<a href="http://www.google.com/" onclick="window.open(this.href, '_blank'); return false;">link</a>[/code]
[/QUOTE]
That only opens a new window if javascript is enabled. That means if the current window and the new window are expected to operate as a pair that would not be possible if javascript were to be disabled.That only opens a new window if javascript is enabled. That means if the current window and the new window are expected to operate as a pair that would not be possible if javascript were to be disabled.[/QUOTE]
[CODE]$hitsLink = '<a target="_blank" href="CIB_hits.php?briefID='.$briefID.'"
onclick="window.open('CIB_hits.php?briefID='.$briefID.'','_blank','height=400,
left=200, location=no, menubar=no, resizable=no, scrollbars=yes, toolbar=no,
top=200, width=600'); return false;">check Director hits</a>';
[/CODE]
then at least it opens a new window when js isn't enabled, albeit with all the window trimmings and a nonworking close button, which I'm mulling over.if I add the target attribute[/QUOTE]Target is deprecated. It validates in HTML 4.01 but is invalid in any later standard.
BTW, what does theWhen you click on a link it is supposed to do [I]something[/I]. [B]return false [/B]stops [I]something [/I]from being executed. In your case it prevents the existing window from loading the link.[COLOR=Navy][B]return [/B] [/COLOR] statement do?[/QUOTE]
Target is deprecated. [/QUOTE]I didn't know that. What's the new way to have a link open in a new window?
I take it back.I take it back again. There was a stray character in what I posted. Actually it works.
With js enabled, my code above opens 2 windows. Oh well.[/QUOTE]
I didn't know that. What's the new way to have a link open in a new window?[/QUOTE]It also doesn't validate in HTML 4.01 strict. There is no replacement as such. The recommendation is what ShrineDesigns posted (javascript).
0.1.9 — BETA 5.28