Results 1 to 5 of 5

Thread: Doctype Question

  1. #1
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Question Doctype Question

    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.
    Cheng

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here's some of one pro's reasons:

    http://www.quirksmode.org/about/quirksmode.html
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Question

    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:
    Code:
    <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:
    Code:
    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,resizable=no';
    win=window.open(mypage,myname,settings);
    }
    Cheng

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Post

    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.
    Cheng

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •