Forums | Email a Colleague | FAQ

Dr. Website Archives

Dr. Website® Archives 2002

June 6, 2002
    Question:
    Dear Dr. Website:
    How would one host a website on an existing website so that the name is www.name.site.com. thank you,

    Answer:
    ANS> What you are referring to is a "second level" domain. Fortunately, we have an article that focuses on that specific issue.

    You can find it on our DomainNotes.com web site, or more specifically, at this URL: http://domainnotes.com/news/article/0,,3371_453061,00.html Thanks,,
    Thanks

    --Dr.Website

    Question:
    Dear Dr. Website:
    I use a Perl script to generate web pages. But now I want to generate three pages at once: one to replace the current browser and two targeted pages, like TARGET=A and TARGET=B. Can I do this?

    Answer:
    I don't believe this is possible as asked, as I know of no way to target a specific browser window or frame from directly within a Perl script.

    You can, of course, target the result of any individual link or form submission using the HTML target attribute:

    <a href="/cgi-bin/myScript.cgi" target="myOtherWindow"> <form action="/cgi-bin/myScript.cgi" method="GET" target="myOtherWindow">

    which works for both named windows and frames that you've already opened (or, if no window with the name exists one is opened. There are some gotchas here, the 4 names "_blank," "_parent," "_top," and "_self" are reserved; and according to the HTML spec clients are allowed to ignore any other target name that begins with an underscore).

    Using JavaScript, you can open multiple windows and load their contents from within a central page, and the contents of those pages can all be supplied from your cgi script.

    In this case, though, you are simply using JavaScript to place three different calls to your CGI, i.e., you might have something like this:

    <script type="text/javascript"> <!-- function loadWindows() { window.open("/cgi-bin/myScript.cgi?page=A","A","");

    window.open("/cgi-bin/myScript.cgi?page=B","B",""); }

    function loadFrames() {

    document.frames['frameA'].location="/cgi-bin/myScript.cgi?page=A";

    document.frames['frameB'].location="/cgi-bin/myScript.cgi?page=B"; } // --> </script>

    <a href="/cgi-bin/myScript.cgi" onClick="loadWindows(); return true">

    and then of course you interrogate the page parameter (or lack thereof) within your Perl and respond accordingly. This is a bread-n-butter example and not without problems. Users (like me) generally detest multiple browser pop-ups, and of course if the browser is set to disable JavaScript then no additional windows are displayed; thus I would only recommend the technique in a controlled browser environment where you have some specific need for the multiple loading windows.

    --Dr.Website

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ForumsEmail a Colleague · FAQ

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs