What the hell is going on here???

Results 1 to 4 of 4

Thread: What the hell is going on here???

  1. #1

    Default What the hell is going on here???

    HI guys,<BR>I have the following bit of code that creates a link on the page..<BR><BR>response.write "&#060;a href=" & RS3("webaddress") & " target=""_blank""&#062;"<BR><BR>In this case RS3("webaddress") = www.egaragesales.com.au<BR><BR>But when viewed on the actual page it shows as "http://www.aboutweb.com.au/www.egaragesales.com.au"<BR><BR>WHY??????<BR><BR>W hen you view the source code its right..???<BR><BR>&#060;a href=www.egaragesales.com.au target="_blank"&#062;<BR><BR>But its pointing at the wrong address???<BR><BR>you can view it here...<BR>http://www.aboutweb.com.au/admin_portfolio.asp<BR><BR>John

  2. #2
    Join Date
    Dec 1969

    Default THINK about it a second...

    When you use something like<BR> &#060;A HREF="somePage.asp"&#062;...&#060;/A&#062;<BR>what is the *actual* page that the browser has to ask the webserver for? <BR><BR>HINT: The browser is *NOT* connected to the web server when somebody clicks on that link! The connection doesn&#039;t happen until afterwards.<BR><BR>Yep, the *ACTUAL* page is <BR> http://www.aboutweb.com.au/somePage.asp<BR><BR>When you omit the "protocol" (http:// is one protocol, ftp:// is another, etc.) from the URL, the browser *AUTOMATICALLY* prepends the base site name (url) of the *current* page!!<BR><BR>So if the current page is<BR> http://www.aboutweb.com.au/somedirectory/somepage.html<BR>and you do<BR> &#060;A HREF="www.egaragesales.com"&#062;<BR>then with no protocol in the URL, what is the poor browser *supposed* to do except presume you meant that to be some page on the current site?<BR><BR>SECOND HINT: Put in the protocol and this won&#039;t happen to you.<BR><BR>

  3. #3

    Default bah! stupid browser

    :-P<BR><BR>Thanks Bill. I owe you *another* coffee.<BR><BR>John

  4. #4
    Join Date
    Dec 1969

    Default LOL!!! If it was *really* stupid...

    ...you&#039;d have to pass full URL with protocol *all* the time. Even for images, for example.<BR><BR>

Posting Permissions

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