• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

javascript links you can't right-click on. Why?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    javascript links you can't right-click on. Why?

    I'm sure there's probably a simple answer for this and I'm a numpty for not knowing it, but I need someone to explain to me what that reason is.

    Why do some web sites have links that cannot be right-clicked on? They are either javascript:__whatever('xxx') or javascript:() or some such.

    They seem to appear most often on web pages where there are a few links I will want to open for future reference, without navigating away from the page I am on. For example, I do a search and the results each come back with one line per result each with a button for more details. Clicking on the button navigates away from the search results page and it is not possible to <right-click> on the button to select 'open in another tab/window'.

    When it happens on job sites, or employer's vacancy lists, or on-line shopping sites, it is really annoying. Because clicking on the button then takes you into a process (filling in an application form, selecting colour/size/qty, etc.) one is taken a long way from the original list and so the search results are lost. I am then unlikely to take full advantage of what the site is there for.

    Basically, I want to be able to keep the search results page open all day and pick and choose off the results at my leisure. Preventing this seems to me to be working against the principle of how the WWW is supposed to work.

    Why are web sites designed this way?
    My all-time favourite Dilbert cartoon, this is: BTW, a Dumpster is a brand of skip, I think.

    #2
    Most likely they are not links worked as links, but links which have some arbitrary code attached to them, activated when clicked. So you can't open in a new tab because there is no URL to open.

    Nick will probably give a better explanation. But yes it annoys me too.
    Originally posted by MaryPoppins
    I'd still not breastfeed a nazi
    Originally posted by vetran
    Urine is quite nourishing

    Comment


      #3
      And while we're at it companys need to realise that they don't endear themselves to me when they 'cut' the back breadcrumb trail to the previous page. When I notice this I immediately stop using that site, there are plenty of others that won't treat me with contempt.

      (Although that sort of thing happens less these days...)
      "I can put any old tat in my sig, put quotes around it and attribute to someone of whom I've heard, to make it sound true."
      - Voltaire/Benjamin Franklin/Anne Frank...

      Comment


        #4
        Originally posted by d000hg View Post
        Most likely they are not links worked as links, but links which have some arbitrary code attached to them, activated when clicked. So you can't open in a new tab because there is no URL to open.
        Not good enough (the reason, not your answer).

        To my simple mind, since the results page was generated by the web server, it should be possible to write code to embed the appropriate links in that results page, rather than embed some code that generates the link. Duh.

        Alternatively, where some form of database is at the back end, have the relationship between the data items returned as results and the link to additional information stored together or based upon one another, then the appropriate link can be embedded in the results page.

        So, still no excuse.

        I don't want to use an 'interactive web application' that poorly represents some of a web site's functionality. I want to use a web site.
        My all-time favourite Dilbert cartoon, this is: BTW, a Dumpster is a brand of skip, I think.

        Comment


          #5
          Originally posted by RichardCranium View Post
          I'm sure there's probably a simple answer for this and I'm a numpty for not knowing it, but I need someone to explain to me what that reason is.

          Why do some web sites have links that cannot be right-clicked on? They are either javascript:__whatever('xxx') or javascript:() or some such.

          They seem to appear most often on web pages where there are a few links I will want to open for future reference, without navigating away from the page I am on. For example, I do a search and the results each come back with one line per result each with a button for more details. Clicking on the button navigates away from the search results page and it is not possible to <right-click> on the button to select 'open in another tab/window'. ...
          You could try ctrl + left_click instead, although that would probably have the same (non-)effect.

          One of my web bugbears is sites that prevent use of the back button, either accidently (one assumes) by a redirect without delay or by somehow deliberately intercepting the back button. It's an example of incompetent and/or aggressively coercive style that you'd think companies would realize by now simply drives customers away.
          Work in the public sector? Read the IR35 FAQ here

          Comment


            #6
            Originally posted by RichardCranium View Post
            Not good enough (the reason, not your answer).

            To my simple mind, since the results page was generated by the web server, it should be possible to write code to embed the appropriate links in that results page, rather than embed some code that generates the link. Duh.

            Alternatively, where some form of database is at the back end, have the relationship between the data items returned as results and the link to additional information stored together or based upon one another, then the appropriate link can be embedded in the results page.

            So, still no excuse.

            I don't want to use an 'interactive web application' that poorly represents some of a web site's functionality. I want to use a web site.
            In many cases, a link doesn't reload a whole page but gets some more data from a web-service which is used to update the page. The idea of web 2.0 (ugh) is that you don't get full page reloads, but the page looks like a proper application rather than a set of pages.

            However there are cases where they do do a whole page load and you can well argue the developers are being lazy, doing too much in javascript. So maybe the answer to your question is "the developers aren't very good".
            Originally posted by MaryPoppins
            I'd still not breastfeed a nazi
            Originally posted by vetran
            Urine is quite nourishing

            Comment


              #7
              WTS. Javascript: just calls some javascript in the current page (on the client side) which could do a thousand different things, only one of which would be a link to another page. So bookmarking it, for example, makes no sense at all.
              Will work inside IR35. Or for food.

              Comment


                #8
                Thread moved. Seemed more sensible for it to be here than general.
                Down with racism. Long live miscegenation!

                Comment


                  #9
                  It's poor practice but you still see it a lot. The href attribute of the link should be the URL of the page it links to. Any additional functionality should be added to the event handler for clicking on the link. That way if a user has javascript disabled then they will still be able to click on the link and reach the intended page. This is known as progressive enhancement.

                  Comment


                    #10
                    Why? Rank incompetence.

                    Originally posted by Bunk View Post
                    It's poor practice but you still see it a lot. The href attribute of the link should be the URL of the page it links to. Any additional functionality should be added to the event handler for clicking on the link. That way if a user has javascript disabled then they will still be able to click on the link and reach the intended page. This is known as progressive enhancement.
                    WBS

                    Comment

                    Working...
                    X