Log in

View Full Version : Doctype Question



Cheng
12-11-2006, 07:29 AM
Hi Everybody.

I wonder why some websites, I'm also some very professional styled ones don't use a Doctype heading.
Is there a reason for it.
Also all or most of all the Google websites don't have a Doctype heading.
Just would like to know if there is a reason for it that some don't use the doctype.

Thanks in advance.

jscheuer1
12-11-2006, 08:27 AM
Here's some of one pro's reasons:

http://www.quirksmode.org/about/quirksmode.html

Cheng
12-11-2006, 09:22 AM
Hi John.

Thanks for link to explain my question.
Since you answered this post I have another question for you.
Quiet a while ago you helped me with popup windows which then I needed to open Flash content.
Now I'm using just a very simple popup script which I understand is in fact only to open images but I use this script to open url's.
Everything is working except the close automatically if clicked somewhere I can't add to this script.
Could you please have a look and tell me what to add so the popup will close if clicked somewhere on the screen.

Thanks in advance.
Cheng.

Link that opens the popup window:
<p><a href="Images/PopUps/popup.html" onclick="NewWindow(this.href,'popup','349','500','no','center');return false" onfocus="this.blur()"><img src="Images/popup_image.jpg" alt="PopUp" width="100" height="149" border="0" /></a></p> Here the javascript:
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,re sizable=no';
win=window.open(mypage,myname,settings);
}

jscheuer1
12-11-2006, 12:01 PM
There really is nowhere in that to do that. And, I'm not entirely clear what it is that you want to do. Closing the new window is easy, click on the [x] close button. If you wanted to create your own close button, it would go in code on or linked to the page that was opened, as would any code to make that page close under certain circumstances, like loss of focus. This last is popular to a degree and is often done like so:


<script type="text/javascript">
window.onblur=function(){self.close();}
</script>

But, this can be annoying to users, many of whom would prefer to decide for themselves when to close the pop up. Consider a dial up user. To reload the pop up would take some time, they would naturally prefer to dismiss it only when they were sure they were finished with it, not have it done for them if they decided to look at something else for a bit.

Cheng
12-11-2006, 12:29 PM
Hi John.

Thanks again.
I never thought of it this way and you are absolutely right.
But it's still good to know how it works.
I tried it out and it's working but I wont use it as you are right.
Never thought about it if someone got a slow connection, then it must be annoying.