Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×

AJAX Inline Dictionary like WallStreetJournal.com 52

chevoldavis writes "Highlight any text on this site then right click. A tooltip containing the definition of the selected word should show up. This tutorial will show you how to accomplish this, step by step. You can modify it to call any function or webservice. This is similar to the WallStreetJournal.com except they show search results in their tooltip window and they leave the functionality of the context menu while I have chosen to supress it. "
This discussion has been archived. No new comments can be posted.

AJAX Inline Dictionary like WallStreetJournal.com

Comments Filter:
  • stop that! (Score:5, Insightful)

    by acvh ( 120205 ) <geek.mscigars@com> on Monday June 26, 2006 @08:16AM (#15604599) Homepage
    I want my right mouse button to do what it always does, not what YOU want it to do.
    • Re:stop that! (Score:3, Informative)

      by red_dragon ( 1761 )

      So you're still using Internet Explorer, then?

      I've just tried it with Firefox, which can optionally prevent JavaScript code from disabling context menus, and the usual right-click menu appeared with the AJAX-generated tooltip beneath it.

      • With the default settings, it does suppress the Firefox context menu, though a second right click does bring it up.

        But if you're using Firefox, there are a number of extensions that give you this functionality across all websites without messing with your context menu, so this hack is just annoying.

      • Re:stop that! (Score:4, Insightful)

        by Tx ( 96709 ) on Monday June 26, 2006 @08:31AM (#15604674) Journal
        And you don't find that annoying? You want to use your contect menu e.g. to copy some text, and then you have to use an additional click to close the pop-up that had appeared behind it, obscuring the article. GPP is right, that's annoying. That's not to say that non-annoying uses couldn't be found for this technique though.
      • Posted that using Safari actually (and yes, I use my right mouse button in OS X). Disabling, or even modifying, a critical operation like a rightclick context menu, is just stupid. What's next, AJAX code to use my spacebar as a backspace key?

        • If you use Safari this whole article is moot: just mouse over any word and hit CTRL+CMD+D to bring up a dictionary panel for the word. (Requires Mac OS X 10.4)
    • So turn off JavaScript or use a different User Agent.

      The web should be what the content producers and designers want you to see. In the coming DRM age, you're not allowed to skip around in your favorite book or read it backwards. You can't repeat parts of songs or movies anymore either.

      <!-- TODO: Replace previous drivel with insightful comment later -->

    • Yeah. I prefer the implementation on eNotes [enotes.com]. You can highlight any word, and press Shift-D to get a definition. Shift-T shows the thesaurus entry, and Shift-S brings up a mini-search.

      Much less intrusive than repurposing the right mouse button.
    • I found the lack of the UI control and handling on the web page disapointing. "dotnetnuke" is a solution to a problem that no longer matters.
  • an ajax article.. (Score:3, Insightful)

    by kwoff ( 516741 ) on Monday June 26, 2006 @08:18AM (#15604611)
    Is this on slashdot because digg is down ?
  • 2 things (Score:5, Funny)

    by giorgiofr ( 887762 ) on Monday June 26, 2006 @08:23AM (#15604637)
    1. I can right-click or double-click any word on any page on the webs and I get a nice "Dictionary" item in my context menu. That's because I use a sensible browser, so I don't depend on your service.
    2. My right-click menu is *sacred*. Really, I kill kittens on its altar every morning. Thou shalt not dare to touch it. For he will not slay thee in thy turn, etc etc. Seriously, don't mess with people's interface. Luckily my fancy browser denies such requests as yours.
    Did I mention I use a cool browser?
    • Well my fancy browser prevents him from suppressing my sacred context menu, but it doesn't stop him opening his pop-up behind it (unless you turn javascript off entirely), which is almost as annoying.

      Face it, there's no cure for asshole web designers short of the firing squad. Well, that or a greasemonkey script or two ;).
  • by Ohreally_factor ( 593551 ) on Monday June 26, 2006 @08:24AM (#15604643) Journal
    This is great, if you define all words as "The remote server returned an error: (500) Internal Server Error."
    • Seems like the next version of the Oxford Dictionary will have that phrase repeated 10 000 times if this site's anything to go by ;)
    • I right-clicked on the word "Slashdotted" and thought, yep, that's about right.

      Even a stopped clock gives the right time twice a day.
  • WSJ doesn't do "at", "to", or "the"

    Submitter site didn't do "to", "the", or "XSLT".

    Am I missing the concept of "any word"?

  • by peesharp ( 985023 )
    It does not work with Opera (9).
    • I don't think that it's because Opera is better or nicer (though I'm sure I could disable it if it did work), I think it's because, for some reason, people are STILL doing browser detection like idiots. Not that I mind, I can't stand the idea of this (leave right click alone!)

      The problem?
      // -- Browser Detection --
      var ie = document.all&&document.getElementById
      var ff = document.getElementById&&!document.all // If the browser is compatible on right-click call the function to get the highlight
    • Menu: Tools -> Preferences
      Advanced Tab
      Content
      JavaScript Options...
      "Allow script to receive right clicks" (unchecked by default)
  • by __aaclcg7560 ( 824291 ) on Monday June 26, 2006 @09:10AM (#15604898)
    So like the Wall Street Jounal website, this inline dictionary has some free word definitions but you need a subscription to see the rest? Not a very useful dictionary...
  • Great, but Wrong (Score:5, Insightful)

    by 99BottlesOfBeerInMyF ( 813746 ) on Monday June 26, 2006 @09:26AM (#15604997)

    I'm sure a lot of us find this kind of crap annoying. A website developer just not have enough information to determine what my most common tasks are and thus properly define a right-click menu for me. I don't want them to have that information. My right-click menu already has a dictionary in it, as well as a handful of other functions. Now this site pops up a second context menu on the page that takes much, much longer to load and has fewer of the functions I want.

    To me this says, "screw you" to users of decent browsers in favor of working around IE + Windows failure to provide a good way to integrate this functionality in the proper location.

    • Just because you're accessing it in a web browser does not make it a 'web site'.

      If I am using a web-based AJAX email client like OWA or RoundCube mail I not only *expect* the right click menu to behave like a native client ( With options like copy message, move message, flag, delete, etc), I *demand* it. The same is true of other browser-based applications that run on Intranets - these types of rich applications are not "web sites" and should not have to behave as such,they should be as rich as possible.

      As
      • Just because you're accessing it in a web browser does not make it a 'web site'.

        Umm, yes, it does. It is a page of markup and the very first line they send to my Web browser contains the Web standard they are employing.

        If I am using a web-based AJAX email client like OWA or RoundCube mail I not only *expect* the right click menu to behave like a native client ( With options like copy message, move message, flag, delete, etc), I *demand* it.

        Not me. If I'm using a Web browser, I demand it treat everyth

        • Not me. If I'm using a Web browser, I demand it treat everything like the content it is. I don't want my controls of my software to be hijacked, or for it attempt to do so. I can already customize my right-click menu, by application and by Web site if I so desire.

          You != eveyone. Most people don't "customize their right click menus", and most people expect the context menu in an application to provide contextual information - if you aren't surfing the web the majority of items in a browser's context menu

          • You != eveyone. Most people don't "customize their right click menus", and most people expect the context menu in an application to provide contextual information...

            But you're talking about running an application within another application. Since you can't possibly know which application your "Web app" is running in, or what tasks they are trying to accomplish and since a right-click menu should always be a secondary access control, I think it is perfectly reasonable to assume that the intermediary layer

            • Again - web this web that. Not everything that runs in a browser runs on the web. Lots of things are internally hosted and having strict requirements on supported platforms and required feature sets is not only OK, but desired. For all you know the application may not be on a web server but running in an internal embedded HTML renderer.

              Rich applications delivering rich functionality need rich APIs, period. And the contextual menu is one of those rich APIs.

              There is absolutely no reason on God's green earth a
              • There is absolutely no reason on God's green earth a web application should be constrained in what it can and can not do with it's GUI simply because it is hosted ina browser.

                Allow me to translate: Lalalalalala... I'm not listening. I refuse to hear that applications running in a Web browser are in any way different and I refuse to acknowledge the existence of said browsers when creating software.

                Should a Web app then be able to run in fullscreen mode. Should it be able to start fullscreen mode when it

  • by arkaino ( 972287 ) <arkaino&gmail,com> on Monday June 26, 2006 @09:39AM (#15605086)
    More useful would be to right click and get a menu with different languages for translating the word I'm highlighting.
    • That would be useful, and possible. I have seen many webservices out there that will so the translation, I didn't think of that, seems it would be more usefull.
      • That extension is great, but if you can do it browser independent as with AJAX, it might be better for users I think.
        • That extension is great, but if you can do it browser independent as with AJAX, it might be better for users I think.

          I strongly disagree. This type of functionality is bounded more by the user than the application. As such, the proper place for it is as a plug-in to the OS. For example, a lot of people would never want to translate anything ever. They can just not enable a translation plug-in. Others will want to translate a lot, and if they do so in their browser, they may well need to in their PDF read

        • Why should every site have to implement a translation/dictionary tool? With a browser extension I can tranlate anything on any site. And it works exactly as I want. There is no complaining about how a particular site decides to implement translation or dictionary lookups. I've even gone so far as to convert a German novel (eBook) to HTML just so I can use gTranslate to help me along. The browser extension is WAY better than anything AJAX on a specific site could deliver.

          AJAX may be good for web site develop
  • prettyprettypretty coolcoolcool!
  • by nitro322 ( 615518 ) on Monday June 26, 2006 @11:56AM (#15606005) Homepage
    Any Firefox/Greasemonkey users out there that are interested in this may also want to check out the Dict script: http://userscripts.org/scripts/show/1467 [userscripts.org]

    It adds a similar, but much less intrusive capability. Simply double-click on any word to highlight it, and the definition is shown in a small window. Once you're done, just click the X (or use my own slgihtly-modified version [legroom.net] and click anywhere on the page) to close it.

    Of course, this has both it's pros and cons as compared to the original idea discussed in the story. Since it's a client-side solution, this isn't something that will be available to your visitors. However, the good news is that it doesn't hijack your browser's context menu, which, as mnay other people have commented, is something I personally despise.
  • When I can click "Ctrl-Apple-D" while hovering over a word?

    Oh crap - I swore I'd never become one of those "Look what my OS can do!!11!" Apple fans. Oh well. Take this is as a tip or hint, then, rather than a snark (as it was originally intended).
  • I'm a Mac user, you insensitive clods!

Two can Live as Cheaply as One for Half as Long. -- Howard Kandel

Working...