• (cs) in reply to Coughptcha
    Coughptcha:
    Bot management?
    That would be Hyperlink 0.2, I guess.
  • (cs) in reply to sparty

    sparty:
    I can actually see a use case for this (well, at least the numbered-link-database-lookup bit); the practice of using a redirect.php?url=http://othersite.com straight up is vulnerable in two ways: a) you can send someone a link to http://wtfsite.com/scriptz/redirect.php?url=http://evilsite.com/ and make it look like wtfsite.com is redirecting them to evilsite.com, possibly implying some sort of endorsement (particularly significant if wtfsite.com has a legitimate use for personal info or sensitive logins) b) aggressive ad-removing proxies (such as Privoxy) can parse the http://.../... out of the URL and do a "fast redirect" to it, bypassing the redirect.php component and your click counter

    simple. Just make your redirect.php only allow relative linking. ie in your case just convert this link http://wtfsite.com/scriptz/redirect.php?url=http://evilsite.com/ into http://wtfsite.com/http://evilsite.com/, that way they get a dead page.

  • Kiss me, I'm Polish (unregistered) in reply to reed

    gnaw
    This stare left intentionally blank.

  • mol (unregistered) in reply to Nifty Difty
    Anonymous:
    Anonymous:


    Yes the whole WTF about Web 2.0 is try to make web applications don't look like web applications. I mean, what's the point in doing this? Even the stupid users have no problems in using standard web applications. Web applications (with current technologies) will never behave like fat GUI clients so it will only confuse users. My conclusion: respect technology possibilities, use them for what they were created, but don't misuse them.


    I think that is quite obvious that you don't "get" 2.0 (hate that term). It isn't to make web applications look more like fat clients, but to be more dynamic, like fat clients. So, you can immediate feed back (drag and drop, selections, sorting, etc etc etc). Those are very nice things to add to a site and make it feel more interactive. Sure, you can stick to the old way, but why? I mean, you could just use static HTML and nothing more as well, but why?

    Whether or not AJAX is the thing that moves the curve along (I don't think it is..people really hate Javascript...soemthing else will be the 'J', in my opinion), programming for the web is due for a change. Just embrace it and learn something new.


    It's not important if you call this web 2.0 or not. I have nothing against sensible use of AJAX. But I'm against emulating fat client in javascript. And that looks to be a trend for some people.
  • parv (unregistered) in reply to doctor.jekyll

    With cookies enabled, Netflix's site works just fine in Opera (Unix) here, including changes in queue, adding a movie, and such.

  • (cs) in reply to tdog
    Anonymous:

    Hey ditto heads,

    No WTF.  Don't see a problem. Yeah, there could be some minor issues here or there, but I doubt there would be much if at all.  Solution seems elegant and data driven enough to scale quite well.  I wonder how many of you actually write web applications.  As you  know, based on requirements, HTML applications can get rather trickey to implement in such a way that doesn't make them look like web applications.  Try again <font color="#555555">Papadimoulis.  </font>

    <font color="#555555">tdog</font>



    Honestly, I have a problem with most web "applications" that try to act like "applications" when they could just as easily do everything I want them to do without using 80% of my cpu!
  • kbiel (unregistered) in reply to tdog
    Anonymous:

    Hey ditto heads,

    No WTF.  Don't see a problem. Yeah, there could be some minor issues here or there, but I doubt there would be much if at all.  Solution seems elegant and data driven enough to scale quite well.  I wonder how many of you actually write web applications.  As you  know, based on requirements, HTML applications can get rather trickey to implement in such a way that doesn't make them look like web applications.  Try again <font color="#555555">Papadimoulis.  </font>



    Yes, this is a serious WTF and gratuitous use of "really cool technology" just because you can.  There are good reasons to abstract the link URLs and possibly keep them in a database, but the retrieving of the real URL and logging of the hit could have easily been accomplished with a URL rewrite.
  • (cs)

    Let me guess. They deliberately built a 2-second-delay into the web service, so the pendulum does not flicker.

  • (cs) in reply to Colin
    Anonymous:
    Umm, if their website is 2.0 (thus the need for such fancy hit logging) then why do they set window.location?  The only time I do a window.location is to refresh the entire page, but that's rare.  This method, by way of the explanation, would refresh the entire page on each click which would basically negate the purpose of having a web 2.0 site which would mean you can go back to ye olde ways of log analyzing.

    Which means the only web 2.0 stuff here is the fancy logging, so the logger exists because of itself.  There's some messed up paradox in here somewhere...


    Dear Paula (Colin, whatever),

    The "messed up paradox in here" is your logic.

    Signed,

    The Brillant Police

  • (cs) in reply to Fred Foobar
    Fred Foobar:
    Alex Papadimoulis:

    When the user clicks on the hyperlink, the followLink() Javascript function is executed and the following occur:

    • a translucent layer (DIV) is placed over the entire page, causing it to appear "grayed out", and ...
    • a "please wait" layer is placed on top of that, with an animated pendulum swinging back and forth, then ...
    • the XmlHttpRequest object is used to call the "GetHyperlink" web service which, in turn ...
    • opens a connection to the database server to ...
    • log the request in the RequestedHyperlinks table and ...
    • retrieves the URL from the Hyperlinks table, then ...
    • returns it to the client script, which then ...
    • sets the window.location property to the URL retrieved, which causes ...
    • the user to be redirected to the appropriate page

    Now that's two-point-ohey.



    My head a splode.
    Was the designer named Rube Goldberg?
    <font size="5">N</font>o!  It was done by Mr. Heath Robinson.

  • (cs) in reply to kbiel

    An artifact of this approach is that it is trivial to spider all the URLs used by the web site.  I'm not sure whether this is a bug or a feature.

    An alternative method is to use GUIDs.

  • risk (unregistered) in reply to Scott Stroz
    Anonymous:
    Anonymous:
        That's not Web 2.0, that's Web Enterprise


    Its Web Enterprise 2.0!


    It's Web2EE SDK 5.0 Update 6!
  • (cs) in reply to Coughptcha
    Coughptcha:
    Surely they could have made the effort to include Regular Expressions in the solution somewhere.  Maybe next time.

    I can hardly wait 'till their users ask them for all the other features browsers have today.  Does this site handle "page back" correctly?  "Open link in new window"?  "Open link in new tab"?  Bot management?


    Ooooh, good point!  While I did think this was an overkill way of hyperlinking, I saw some gems in the process.  But your point is very valid and important.  Users on this site will be used to using those features, and I don't see how the browser will be able to handle this appropriately...

  • LQQK AY MY NEW TOY!!!!!1 (unregistered)

    What amuses me to no end is that ten years ago, we only had to deal with first-year university students playing around with new Web 1.0™ technology and creating hideous personal web sites with leopard print backgrounds, embedded MIDI tunes, and IMAGE MAPS!!!!!!1!!!11 (remember B1FF?). Now we have large corporations doing this.

    It almost makes me actually nostalgic for the <BLINK></BLINK>tags. At least that was something straightforward and less likely to cause browsers to crash Hindenburg-like into the ground.

    --
    $0.02

     

  • Ia! Ia! (unregistered) in reply to LQQK AY MY NEW TOY!!!!!1
    Anonymous:

    What amuses me to no end is that ten years ago, we only had to deal with first-year university students playing around with new Web 1.0™ technology and creating hideous personal web sites with leopard print backgrounds, embedded MIDI tunes, and IMAGE MAPS!!!!!!1!!!11 (remember B1FF?). Now we have large corporations doing this.

    It almost makes me actually nostalgic for the <blink></blink>tags. At least that was something straightforward and less likely to cause browsers to crash Hindenburg-like into the ground.

    --
    $0.02

     


    What's wrong with image maps?
  • (cs) in reply to Coughptcha

    Finally we've found what the "2.0" actually stands for! Two server requests per link clicked!

  • naysayer (unregistered) in reply to Ia! Ia!

    The implementation could have been more efficient, but this isn't really such a big deal.

    There's nothing wrong with using javascript like this to add visual or usability enhancements provided you also take into account browsers that don't support that stuff. Unless of course you think we should all move back to DOS.

  • fatih (unregistered)
    • retrieves the URL from the Hyperlinks table, then ...
    • returns it to the client script, which then ...
    • sets the window.location property to the URL retrieved, which causes ...
    • the user to be redirected to the appropriate page

      hey, i dont think this is a good idea. What if the response returns the HTML code for the new page, instead of url? Would not it be faster?

      I also think that roundtrip to database each time to retrieve a link url is something that slows down  your application and response time. I think about a solution in which you can put a javascript function in body onload event, which, when the page is loaded makes a call to the server using xmlhttp and sends the information you want to log in the server. Is not that a better solution?

      I mean something like this:

      Comments?

       

  • Ran (unregistered)

    That would be the end road for search engine crawlers and text browsers. (unless you provide a "text only" link).

  • (cs) in reply to naysayer
    naysayer:
    The implementation could have been more efficient, but this isn't really such a big deal.

    There's nothing wrong with using javascript like this to add visual or usability enhancements provided you also take into account browsers that don't support that stuff. Unless of course you think we should all move back to DOS.


    But in this case, there is IMO no visual or usability enhancement for the user.

  • Dustman (unregistered) in reply to Maurits
    Maurits:
    An artifact of this approach is that it is trivial to spider all the URLs used by the web site.  I'm not sure whether this is a bug or a feature.

    An alternative method is to use GUIDs.


    Really? For an outside spider like, say, Google's? Seems to me like just the opposite. Do tell.
  • (cs) in reply to Dustman

    int i=0;
    while(getPage("http://somesite.com/get.php?id="+i)!=FILENOTFOUND)
      crawl(thatPage);


  • tdog (unregistered) in reply to sammybaby
    sammybaby:

    (Okay - perhaps they used a stored procedure. That's still one extra db operation for every page hit.)

    Oh no! A WHOLE extra hit, whatever shall we do?  Perhaps we should just load the entire database into Application State.  Common!

    tdog

  • tdog (unregistered) in reply to mol

    Anonymous:

    Yes the whole WTF about Web 2.0 is try to make web applications don't look like web applications. I mean, what's the point in doing this?

    Thats right, screw your customers.  Let them eat cake right?  And besides, if you give them something that doesn't look like crap, they might start expecting more.  Keep on managing those expectations.   

    tdog

  • tdog (unregistered) in reply to GoatCheez

    GoatCheez:


    Honestly, I have a problem with most web "applications" that try to act like "applications" when they could just as easily do everything I want them to do without using 80% of my cpu!

    80% of your CPU.  Yeah that would suck.  Thats not what I'm talking about when I refer to rich clients.  That sounds like one of those Flash applications.  They can go the doedoe if you ask me. 

    tdog

  • tdog (unregistered) in reply to kbiel

    Anonymous:


    Yes, this is a serious WTF and gratuitous ....

    Did I mention that I like the word gratuitous?  Ding ding ding.  Winner!  Bravo chap. 

    tdog

  • hinek (unregistered)

    Please, I know, this is kind of anonymous, but I need a link. I need to see this.

  • kormoc (unregistered) in reply to Lumpio-
    Lumpio-:
    Because it doesn't exist.

    That's mostly true, but there is a blink css attrib, text-decoration: blink.

    See http://en.wikipedia.org/wiki/Blink_tag for more info

  • (cs)

    How do they track referrerrs then? This is IMHO far more interesting than tracking in-site traffic..

  • csrster (unregistered)

    What kind of syntax is href="Javascript: some_crap()" ? Is that some
    standard I don't know about because only lame-brains use? The
    rest of us use onclick() whhen we're in 2.0 mode.

  • Will (unregistered) in reply to Coughptcha

    This person clearly has no idea how to write real Web two-point-oh websites.  Who uses window.location!?  If it was a real two-point-oh website, it would use yet more JavaScript goodness to replace the markup of the page without even redirecting!

  • qbolec (unregistered)

    Well I must admitt to have something similar on my webpage. The reason is that some of the links are external - they point to other servers, but you still want to make some stats about them. (that's why I believe testing logs is not enought). So I use database for stats. Are those two queries bad? Not really, generating the forum page takes about 100 of them. But you can obviously make it in one call - and so do I . I just increment stats for page given as an argument to redirect.php?url=...

    But I definetely don't use javascript for that. As pointed out before it kills "open in new window"etc. functionality.

    But still it is nice to entertain the user, so my suggestion is: use href="redirect.php?url=..." and separate OnClick event with javascript show. This way you'll get both. And it should work with js disabled.

  • (cs)

    Why didn't they make another database call and load HTML from the database and write it to a contentDiv.innerHTML property?

  • anonymous (unregistered) in reply to csrster

    The way to go is:
    <a href="redirect.php?id=332" title="bla bla bla">

    But, you can even do that:
    <a href="pagwhatever.php" onclick="niceness(this)" title="bla bla bla">
    so clicking on "bla bla bla" do the div and clock thing, its backward compatible and its 2.0.

    Anyway is better to parse the logs

    --Tei

  • RichNFamous (unregistered)

    It's cool but it still needs more Enterprise.

  • Niffux (unregistered) in reply to RichNFamous

    Another bad thing; The javascript in the urls (same as for javascript popups to e.g. movie clips or in image galleries) messes up the middle/shift clicking thing that's made tabbed browsing so popular. On a normal site you could middle click an inline link on a page, have it open in a background tab, continue reading uninterrupted, close the current page, and go to the new page opened. The javascript links would just open a blank page.

    If you need to count the number of hits on a specific page / want to keep the number-system (for whatever reason), go with the php-file-that-logs-and-serves-a-302-header instead. If you want to count the number of hits from a specific link, check the HTTP_REFERER header, or send an extra GET request with the link.

  • Sybren (unregistered)

    A few days ago, I saw what must be one of the most awful ways of following a link:

    {a href='javascriptdocument.location.href("forgotten-password.asp");'}forgot your password?{/a}

    Calling document.location.href as a function??? That only works on MSIE I guess. Somehow, those people managed to get so brain-damaged that they can't even create a cross-browser link to a page! This really twists my stomach...

  • (cs) in reply to Mr Beeper
    Mr Beeper:
    The pendulum is a great touch.  But the real WTF is (tm) that they didn't use the jepoardy theme song for their "wait music".  And the pendulum should've been a video, not a graphic.


    True, but you didn't go far enough . . . obviously you can't think like a real PHB.

            Developer:  Okay, I've put in the video for the delay like you asked.
            Boss:  I already looked at it, and it's not what I wanted!
            Developer:  Huh?  But you said -
            Boss:  It's the same video every time, no matter which link I click on!  I want to see a different video for each page.  Here, I had George make a list of the ones I want to see.  I'll expect them to be online after lunch.

    which of course leads to "followLink(124)" having to do a separate database lookup to determine which WMV to load . . .

    ok
    dpm
  • James (unregistered) in reply to dpm

    Breaks the back button!

    Ah, 1999, I remember you fondly [*-)]

  • (cs) in reply to RichNFamous
    RichNFamous:
    It's cool but it still needs more Enterprise.


    Correct.
    <script src="enterprise_links.js" type="text/javascript"></script>
    ...
    <a href="Javascript: followLink(ENTERPRISE_LINKS.LINK_124);">View Products</a>

    Source of enterprise_links.js:

    ...
    ENTERPRISE_LINKS.LINK_124 = '125'; // fix me
    ...
  • (cs) in reply to James

    Breaks the back button!
    This can be a feature, often you design a process with steps, 3, 2, 1.. and dont want user moonwalking your site.

  • Diado (unregistered) in reply to naysayer
    Anonymous:
    The implementation could have been more efficient, but this isn't really such a big deal.

    There's nothing wrong with using javascript like this to add visual or usability enhancements provided you also take into account browsers that don't support that stuff. Unless of course you think we should all move back to DOS.



    How does this javascript "add visual or usability elements"? It does nothing visual, and anything you wanted to do visually could probably be done very easily through CSS without using javascript. Usability-wise it adds nothing, but instead severely subtracts it. No opening in new windows or tabs. No understanding of what page the link will take you to without clicking it. No right-clicking on the link and bookmarking it or copying the location to open it in a different browser. No accessibility. No access for anyone with javascript turned off or on a browser which doesn't support javascript. This code adds nothing at all to the user experience in any way, shape, or form.

  • Diado (unregistered) in reply to Diado

    Ooops... "does nothing visual" should read "does nothing visual of value".

  • (cs) in reply to Niffux
    Anonymous:
    Another bad thing; The javascript in the urls (same as for javascript popups to e.g. movie clips or in image galleries) messes up the middle/shift clicking thing that's made tabbed browsing so popular. On a normal site you could middle click an inline link on a page, have it open in a background tab, continue reading uninterrupted, close the current page, and go to the new page opened. The javascript links would just open a blank page.

    If you need to count the number of hits on a specific page / want to keep the number-system (for whatever reason), go with the php-file-that-logs-and-serves-a-302-header instead. If you want to count the number of hits from a specific link, check the HTTP_REFERER header, or send an extra GET request with the link.

    I'm curious as to the advantages of having PHP serve a 302 (or a 307, perhaps?) versus having the webserver do it natively (e.g. Apache's RewriteRule or RewriteMap)?

  • maht (unregistered) in reply to onovotny


    onovotny:

    and reduce 404 errors. 



    why would you want to do that ?

    If the page doesn't exist it is 404, all you end up doing is a page that says "page not found" but doesn't show up as a 404 in your logs LIKE IT SHOULD DO

    But hey, it is microsoft, the Ultimate Enterprise wannabes


     

  • (cs) in reply to Coughptcha
    Coughptcha:
    Anonymous:
    Another bad thing; The javascript in the urls (same as for javascript popups to e.g. movie clips or in image galleries) messes up the middle/shift clicking thing that's made tabbed browsing so popular. On a normal site you could middle click an inline link on a page, have it open in a background tab, continue reading uninterrupted, close the current page, and go to the new page opened. The javascript links would just open a blank page.

    If you need to count the number of hits on a specific page / want to keep the number-system (for whatever reason), go with the php-file-that-logs-and-serves-a-302-header instead. If you want to count the number of hits from a specific link, check the HTTP_REFERER header, or send an extra GET request with the link.

    I'm curious as to the advantages of having PHP serve a 302 (or a 307, perhaps?) versus having the webserver do it natively (e.g. Apache's RewriteRule or RewriteMap)?

    Fact that you can do specific actions (e.g. logging the hit) before the redirection?

  • (cs) in reply to mcguire
    Anonymous:

    If you did that, the user wouldn't hardly have any time at all to appreciate the animation and user interface genius-osity.


    Genious-osity is my new favorite word.
  • (cs) in reply to masklinn

    We kind of do something similar here (on one of the worlds most 'hit' websites) but with a more sane way of doing things. Each link has a target id and a source id. These are all generated by a pretty hefty CMS and publishing system. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    This is changing (already) to a new system which sends you straight to the link, but a call is fired off to a web service with various information about the source link, and the target. (The old system had the problem, that if the link services went down.. all the links stopped working).<o:p></o:p>

    It's all quite necessary to monetize the site correctly.<o:p></o:p>

     

  • GN (unregistered) in reply to Willie
    Anonymous:
    Wow, they implemented the browser inside the browser! Its like writing a compiler in the language your compiling, except not.

    Or it is like writing a message in a language you do not quite speak.

  • (cs) in reply to maht
    maht:

    onovotny:

    and reduce 404 errors. 



    why would you want to do that ?

    If the page doesn't exist it is 404, all you end up doing is a page that says "page not found" but doesn't show up as a 404 in your logs LIKE IT SHOULD DO



    A really clever system could use heuristics to find the right page, or the page at it's new location, and send a redirect instead of the 404.

Leave a comment on “Hyperlink 2.0”

Log In or post as a guest

Replying to comment #:

« Return to Article