• John (unregistered)

    <first="frist"/>

  • Quite (unregistered)

    "Slugify"? What sort of a word is "slugify"? The word is "slugificationalise". Or "-ize" if you prefer American English, of course.

  • Anon (unregistered) in reply to Quite

    I do prefer American English.

    'Merica!

  • DocMonster (unregistered) in reply to Quite

    "slugify" is the way Django has always used it.

    I do think that using javascript to do a link is stupid, but the data-* stuff is used commonly in frameworks like KnockoutJS to work its behind the scene binding. That I feel is fine, but this is stupid and won't work on browsers with javascript disabled.

  • DocMonster (unregistered) in reply to Quite

    "slugify" is the way Django has always used it.

    I do think that using javascript to do a link is stupid, but the data-* stuff is used commonly in frameworks like KnockoutJS to work its behind the scene binding. That I feel is fine, but this is stupid and won't work on browsers with javascript disabled.

  • Tof (unregistered)

    Often this is done so that Google doesn't see these as real links.

    In this case, it sucks anyway, but it's totally legit. Fracking SEO.

  • djingis1 (unregistered)

    Did someone say S-expressions?

  • Andrew (unregistered)

    This is garden variety "you're doing it wrong." I don't think it warrants a WTF. Perhaps once upon a time, there was some logic here that got removed?

  • Dan Bugglin (google)

    Ha, my coworker did one better. He did something like this:

    <a id="downloadLink>Download

    <a id="dashboardLink>Administrative Dashboard

    ...

    $("a").click(function() { if (this.id == "downloadLink") { location.href = locale.get("downloadPage"); } else if (this.id == "dashboardLink") { location.href = locale.get("dashboardPage"); } });

    So not only does he make the WTF in this article, he adds extra layers on top of it, such as using the same function to handle both links, and using language-specific string files to store urls. It's a string, so it can go in there, right?

    Addendum 2016-10-26 08:25: Edit: Wow, is that a WTF on this comment form I see? Sanitizing user input by looking for and removing specific user input (closing anchor tags)? For shame!

  • MaxArt (unregistered) in reply to Andrew

    Hm... If you hijack a link to do what a link does, and better, it is really a WTF.

  • D-Coder (unregistered)
    <!-- Easy Reader Version: I've invented a better wheel, and this one is square! -->

    Well duh! On slopes, it doesn't roll away like the old ones!

  • (nodebb) in reply to Quite

    It's a Boris word you slughead.

  • (nodebb) in reply to Dan Bugglin

    Wow, is that a WTF on this comment form I see?

    No, this whole site is the WTF.

  • Anon (unregistered) in reply to Tof

    Why is it "legit"? Smells like bullshit. Design your site properly, don't rely on hacks.

  • Herr Otto Flick (unregistered) in reply to Anon

    You can design your site however you like, but you can't design PageRank without being Google.

  • Foobar (unregistered) in reply to Tof

    I'm not into SEO, so could you explain, if they want Google to ignore the link, why not just use rel="nofollow"?

  • Anon (unregistered) in reply to Foobar

    +1

    Or use a robots.txt

  • Not WTF (unregistered)

    I'm sorry, but this really isn't a WTF. I've done this a few times to change a specific subsection portion of the page without having to go and do a full page repaint (i.e. AJAX refreshing). It may not be 100% elegant, and I would bet that at some point they had the Main menu items be relatively static on the page with the portlet to the active section changing, but they redesigned the entire site and didn't understand the change.

  • Angus (unregistered) in reply to Foobar

    There are also the other idiot bots that don't listen to robots.txt or to any other flags and just spam the heck out of your product search filters.

  • just me (unregistered) in reply to Not WTF

    And you do that by setting document.location? Now I'm not a web dev, but I don't think that's the right way to do an AJAX request.

  • (nodebb)

    In response to @Tof:

    Somewhere I've read the Google bots do execute ECMAScript, so this seems to be an extra clever way to get downranked for obscuring links.

    AND, it is a clever way to tell potential customers, "we don't care for your choice to save your nerves by turning off JavaScript, nya nya nyaaaa!"

    In response to @Andrew:

    There surely once was a good reason to do something like this, but it went totally bullshit during the process of cargo-culting. (Or do you say, cargo-cultification?)

    In response to @Dan Bugglin -> Addendum:

    Insanitation of user input seems suitable for an insane site.

    (I hope the @ character doesn't have some special meaning for the forum software)

  • Bulletmagnet (unregistered)

    This is why we can't have nice things (like a navigable site without JavaScript turned on). If your link doesn't have a href, I hate you.

  • Not WTF (unregistered) in reply to just me

    It may not be 100% elegant, and I would bet that at some point they had the Main menu items be relatively static on the page with the portlet to the active section changing, but they redesigned the entire site and didn't understand the change.

  • jay (unregistered) in reply to Not WTF

    "change a specific subsection portion of the page without having to go and do a full page repaint" I suppose if you had one or two links on a very large and complex page, downloading a small updated Javascript rather than refreshing the entire page could save on bandwidth. My first thought would be that the complexity of that is not worth saving the trip to the server -- any future programmer trying to maintain the page would have to figure it out -- but it would depend on the details.

  • jay (unregistered)

    I've seen plenty of programmers do things in an unusual and overly complex way to prove that they're smart enough to understand this overly complex code. Oh yeah, anybody can write a line of code to add two numbers together, but I managed to do it by creating a SOAP interface, sending the numbers in XML, creating a new database on the fly, and building a query that adds the numbers. You say that takes longer than just writing one line to add the numbers? Well that's why I cache the results of previous additions, and before executing the SOAP call check if we already have the result of this addition in cache ...

  • isthisunique (unregistered)

    I've had the opposite problem a lot with exactly this approach.

    If you make a load the main page once web application then things like links and form elements don't make as much sense. Instead buttons are created using a combination of javascript and CSS. In this case, nearly everything is a div. HTML pre-provides some nice things but when using a very custom interface they can get in the way. Even if you can use them, it comes back to bite you later especially as it creates a lot of inconsistency. You end up blacklisting behaviour and appearance in places instead of building it up which tends to be more bug prone. Yet people still will use things like an a tag with href="#" for buttons that are entirely virtual.

    Using data- in a templating system is fine for anchors. The WTF here is that there was already a templating system on the backend and that using the data attribute here serves no purpose. If it instead pointed to something else where that would make more sense.

  • nnm (unregistered)

    This is actually a user tracking technique. Usually the javascript handler logs user clicks and time spent on page to some server. Also would force people to turn on javascript and to disable add-blockers, since the site would be non-functional otherwise. We can expect this to become a standard.

Leave a comment on “data-wheel="reinvented"”

Log In or post as a guest

Replying to comment #469171:

« Return to Article