| Forums | Email a Colleague | FAQ |
|
Dr. Website® Archives 2002June 6, 2002
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: 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,,
--Dr.Website Question: Answer: 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|