- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
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.
Admin
gnaw
This stare left intentionally blank.
Admin
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.
Admin
With cookies enabled, Netflix's site works just fine in Opera (Unix) here, including changes in queue, adding a movie, and such.
Admin
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!
Admin
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.
Admin
Let me guess. They deliberately built a 2-second-delay into the web service, so the pendulum does not flicker.
Admin
Dear Paula (Colin, whatever),
The "messed up paradox in here" is your logic.
Signed,
The Brillant Police
Admin
Admin
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.
Admin
It's Web2EE SDK 5.0 Update 6!
Admin
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...
Admin
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
Admin
What's wrong with image maps?
Admin
Finally we've found what the "2.0" actually stands for! Two server requests per link clicked!
Admin
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.
Admin
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?
Admin
That would be the end road for search engine crawlers and text browsers. (unless you provide a "text only" link).
Admin
But in this case, there is IMO no visual or usability enhancement for the user.
Admin
Really? For an outside spider like, say, Google's? Seems to me like just the opposite. Do tell.
Admin
int i=0;
while(getPage("http://somesite.com/get.php?id="+i)!=FILENOTFOUND)
crawl(thatPage);
Admin
Oh no! A WHOLE extra hit, whatever shall we do? Perhaps we should just load the entire database into Application State. Common!
tdog
Admin
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
Admin
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
Admin
Did I mention that I like the word gratuitous? Ding ding ding. Winner! Bravo chap.
tdog
Admin
Please, I know, this is kind of anonymous, but I need a link. I need to see this.
Admin
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
Admin
How do they track referrerrs then? This is IMHO far more interesting than tracking in-site traffic..
Admin
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.
Admin
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!
Admin
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.
Admin
Why didn't they make another database call and load HTML from the database and write it to a contentDiv.innerHTML property?
Admin
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
Admin
It's cool but it still needs more Enterprise.
Admin
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.
Admin
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...
Admin
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
Admin
Breaks the back button!
Ah, 1999, I remember you fondly [*-)]
Admin
Correct.
...
Source of enterprise_links.js:
...
ENTERPRISE_LINKS.LINK_124 = '125'; // fix me
...
Admin
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.
Admin
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.
Admin
Ooops... "does nothing visual" should read "does nothing visual of value".
Admin
Admin
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
Admin
Fact that you can do specific actions (e.g. logging the hit) before the redirection?
Admin
Genious-osity is my new favorite word.
Admin
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>
Admin
Or it is like writing a message in a language you do not quite speak.
Admin
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.