The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

AJAX without the A and the X

Last post 07-24-2008 11:14 AM by MasterPlanSoftware. 18 replies.
Page 1 of 1 (19 items)
Sort Posts: Previous Next
  • 07-20-2008 3:50 PM

    • fbjon
    • Top 500 Contributor
    • Joined on 07-04-2007
    • Posts 65

    AJAX without the A and the X

    Copypasted from a submission from a while ago, there might be some errors:

    While trawling the net to find that one really good but elusive album, I came upon this gem of a music store. Searching for anything at all causes the server to dump a 120+ KB html file with embedded javascript onto the client. Since the site is otherwise exceedingly spartan, I examined the source of the frame, and found the attached abomination.

    Now, at first glance it's just the 1247 array assignments that stick out, one for each product in the store. A second glance shows that the search is an iteration over this array, comparing with the search string. The operative expression is:

    if (search_items[i].name.toLowerCase().indexOf(parent.parent.parent.extra.core.searchPhrase) != -1) {

    Some nice cross-frame scripting there. The search page is basically built with javascript entirely on the client, using data sent to the client embedded in javascript.

    The store is at http://www.cd-kauppa.fi/ but isn't the real perpetrator, since they're just using a webstore package from Shopfactory. Some googling reveals another site using that package and having the same flaw. This does appear to be an older version of the software, though.

    Unfortunately, the newer versions I found are starting to have a quite enterprisey feel to their frame/javascript complexity. For instance the page at http://www.ninisfavorites.com/ (uses version 6), looking at toc.html in the left frame, I count at least 11 separate script tag blocks. Towards the end of the file is this one, that causes the search box to be displayed:

    <input class="SearchTextField" type="text" name="phrase" size="12" maxlength="40" value="lds" onfocus="javascriptif(this.value==\''+ld('LD_SEARCHPHRASE')+'\')this.value=\'\';" onblur="javascriptif(this.value==\'\')this.value=\''+ld('LD_SEARCHPHRASE')+'\';">

    The dw() function is simply this:

    function dw(s){document.write(s);}

    In fact, this function is used all over the place. The ld() function on the other hand fetches a string from the top document in the frameset stack, probably for I18N purposes, but with its obfuscation and eval() calls, I'm getting headaches by now. I'm almost suspecting that the whole thing is some kind of client-side dynamic web site...

    Speaking of frameset stack, the journey continues: using the DOM inspector, I count 7 different framesets with a max nesting level of 5, while tables come in at 10, nesting level 3. Total amount of script tags: 58.

    I found a version 7 lite laying around in the usual shady repositories for software and installed it, and it offered some improvement: just one frameset and 54 script tags from the main page. As browser punishment, it introduces 34 iframes instead, and I didn't even put in any content yet.

    I attempted to download a trial version just for kicks, but they wanted an email address, with the explicit intention to put it on their mailing list with no opt-out and an alleged unsubscribe, so I passed on that. The price seems to be 319 / 639 euro for pro/gold version respectively.


    Unfortunately, (or fortunately), the music store ultimately didn't have the CD I was looking for.

  • 07-20-2008 5:26 PM In reply to

    Re: AJAX without the A and the X

    This type of crap is all over some of the pages I have to maintain at my current job. Most of it was written 6 years ago and has grown into an unmanageable mess.
  • 07-20-2008 7:47 PM In reply to

    • u2892
    • Not Ranked
    • Joined on 04-15-2008
    • Posts 5

    Re: AJAX without the A and the X

     Give them a mailinator address and try it out :)

    Is the dw() thing really a wtf though? It does save a few keystrokes...

  • 07-20-2008 8:04 PM In reply to

    Re: AJAX without the A and the X

    u2892:
    Is the dw() thing really a wtf though? It does save a few keystrokes...

    And bandwidth.  My assumption was that the OP was saying that using document.write() is retarded. 

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.
  • 07-21-2008 1:51 AM In reply to

    Re: AJAX without the A and the X

     Wow- this really reminds me of the community server reply page!

    However, things actually improved. This page has only 147kb. And the "automatic tag completion" seems quite fast now.

  • 07-21-2008 7:05 AM In reply to

    • fbjon
    • Top 500 Contributor
    • Joined on 07-04-2007
    • Posts 65

    Re: AJAX without the A and the X

    morbiuswilters:
    And bandwidth.  My assumption was that the OP was saying that using document.write() is retarded. 
    Good point. I was thinking purely from a design perspective, but it does probably save some keystrokes and code size. Then again, most variable names are normal-sized, in particular the search_table could be shortened to just s to save at least 13 KB per search page load.
  • 07-21-2008 9:29 AM In reply to

    Re: AJAX without the A and the X

    morbiuswilters:

    u2892:
    Is the dw() thing really a wtf though? It does save a few keystrokes...

    And bandwidth.  My assumption was that the OP was saying that using document.write() is retarded. 



    Not only bandwidth, but server CPU cycles as well, since the client handles all of the search functionality itself... Brillant! (I wonder how many resources it takes to serve up this monster of a page to every user, though...)

    Enterprise Software Design Lifecycle:

    1) Receive business case approval
    2) Leverage a dynamic solution
    3) ???
    4) Value added = Profit!
  • 07-21-2008 9:43 AM In reply to

    Re: AJAX without the A and the X

    Juifeng:

    Wow- this really reminds me of the community server reply page!

    However, things actually improved. This page has only 147kb. And the "automatic tag completion" seems quite fast now.

    The random TagExceptions created by the script I wrote have been purged.  That added about 500k to every thread view if you were logged in.

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.
  • 07-21-2008 2:32 PM In reply to

    Re: AJAX without the A and the X

    morbiuswilters:
    The random TagExceptions created by the script I wrote have been purged.  That added about 500k to every thread view if you were logged in.
     

    Wow, thanks. Jackass. 

  • 07-21-2008 3:06 PM In reply to

    Re: AJAX without the A and the X

    Zylon:
    Wow, thanks. Jackass.

    Why don't you bawl some more?  It was create to illustrate the retarded way Community Server was handling tag selection. 

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.
    Filed under:
  • 07-21-2008 3:47 PM In reply to

    Re: AJAX without the A and the X

    morbiuswilters:
    Why don't you bawl some more?  It was create to illustrate the retarded way Community Server was handling tag selection.

    ...and inconvenience all registered users in the process. Hence why you are, in fact, a jackass.

  • 07-21-2008 3:51 PM In reply to

    Re: AJAX without the A and the X

    Zylon:

    morbiuswilters:
    Why don't you bawl some more?  It was create to illustrate the retarded way Community Server was handling tag selection.

    ...and inconvenience all registered users in the process. Hence why you are, in fact, a jackass.

    It's a site about technical blunders running very WTFy forum software.  To not exploit it for amusement and profit would be wrong. 

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.
    Filed under:
  • 07-21-2008 10:39 PM In reply to

    Re: AJAX without the A and the X

    morbiuswilters:

    It's a site about technical blunders running very WTFy forum software.  To not exploit it for amusement and profit would be wrong. 

    Agreed.

    Coincidentally, if you type a capital T in the tag field, it auto-completes TABLE_CAT. Release shift and you get TABLE_CATag abuseg abuse. OK, shoot, I want to delete this crap, so I hit home-shift-end. Now I have: TABLE_CATag abuseg abuse exception 0xDEADBEEF. WTF!?!?

  • 07-22-2008 3:38 AM In reply to

    • ammoQ
    • Top 10 Contributor
    • Joined on 04-13-2005
    • Vienna.Austria.Europe.Earth
    • Posts 3,330

    Re: AJAX without the A and the X

    morbiuswilters:
    It's a site about technical blunders running very WTFy forum software.  To not exploit it for amusement and profit would be wrong. 
     

    Everyone including Alex agrees that TRWTF is community server. That said, deliberately making it worse for all forum members can get you banned.

    beanbag girl 4ever
  • 07-23-2008 11:26 AM In reply to

    Re: AJAX without the A and the X

    ammoQ:

    Everyone including Alex agrees that TRWTF is community server.

    So, this revelation tells me that CS is TRWTF and I should just disregard those "lern 2 use da forum software" posts? ;)
  • 07-23-2008 12:12 PM In reply to

    Re: AJAX without the A and the X

    danixdefcon5:
    So, this revelation tells me that CS is TRWTF and I should just disregard those "lern 2 use da forum software" posts? ;)

    CS is a WTF from the way the code works.  Not knowing how to use a simple WYSIWYG editor or quoting feature is still moronic. 

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.
  • 07-24-2008 10:18 AM In reply to

    Re: AJAX without the A and the X

    morbiuswilters:
    Not knowing how to use a simple WYSIWYG editor or quoting feature is still moronic.

    Except when said WYSIWYG editor decides not to load, as it seems to have done today. Many post WTF's have been because the standard editor fails to load, without clicking anything... it just doesn't load.

    Quoting mistakes, however, are true n00b mistakes.

  • 07-24-2008 10:41 AM In reply to

    Re: AJAX without the A and the X

    danixdefcon5:
    Except when said WYSIWYG editor decides not to load, as it seems to have done today. Many post WTF's have been because the standard editor fails to load, without clicking anything... it just doesn't load.

    This is caused by sluggish response from the server.  It's sucky but it's not the editor's fault and people who complain frequently are messing up the formatting on their own or are using a crappy browser that doesn't work with the editor.  Also, it's not like determining if you are using WYSIWYG is that difficult. 

    < pstorer> Bans don't mean shit on the forum. It's like being on the Sex Offender List. You can still entice kids into your van with candy.

    Want more? Go the IRC channel #TDWTFMafia on irc.slashnet.org.
  • 07-24-2008 11:14 AM In reply to

    Re: AJAX without the A and the X

     

    danixdefcon5:
    Except when said WYSIWYG editor decides not to load, as it seems to have done today.

    That has nothing to do with the editor, but more your connection or patience.

    Filed under:
Page 1 of 1 (19 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems