a href with static and dynamic content using JavaScript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • schuessi

    #1

    a href with static and dynamic content using JavaScript

    Hello all

    I'm quite new to web development, so please be kind ;)

    I have a JS-function called getObjURL() which should return an URL-
    String of an JS-object.

    In the body part I use something like this:

    <a href="../mystaticlink.ht m?parameter=jav ascript:getObjU RL()"
    target="_blank" ...>Linktext</a>

    but this doesn't work.
    I also tried:
    <a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
    target="_blank" ...>Linktext</a>
    <a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
    target="_blank" ...>Linktext</a>
    .... and some other stupid things.

    Could you please help me out of this?! Will it ever work or do I have
    to use other web-technologies to create my dynamic link?

    Best regards,
    Schuessi
  • Suhas Dhoke

    #2
    Re: a href with static and dynamic content using JavaScript

    On Oct 29, 3:31 pm, schuessi <schuessmas...@ googlemail.comw rote:
    Hello all
    >
    I'm quite new to web development, so please be kind ;)
    >
    I have a JS-function called getObjURL() which should return an URL-
    String of an JS-object.
    >
    In the body part I use something like this:
    >
    <a href="../mystaticlink.ht m?parameter=jav ascript:getObjU RL()"
    target="_blank" ...>Linktext</a>
    >
    but this doesn't work.
    I also tried:
    <a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
    target="_blank" ...>Linktext</a>
    <a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
    target="_blank" ...>Linktext</a>
    ... and some other stupid things.
    >
    Could you please help me out of this?! Will it ever work or do I have
    to use other web-technologies to create my dynamic link?
    >
    Best regards,
    Schuessi
    Hello Schuessi.
    try this..

    <script language="JavaS cript" type="text/javascript">
    function getParam() {
    return 'first';
    }
    function getLink() {
    document.getEle mentById('link' ).href= 'mystaticlink.h tm?
    parameter=' + getParam();
    }
    </script>
    <a href="#" onclick="getLin k();" id="link">First </a>

    Comment

    • schuessi

      #3
      Re: a href with static and dynamic content using JavaScript

      On 29 Okt., 11:48, Suhas Dhoke <suhasdh...@gma il.comwrote:
      On Oct 29, 3:31 pm, schuessi <schuessmas...@ googlemail.comw rote:
      >
      >
      >
      Hello all
      >
      I'm quite new to web development, so please be kind ;)
      >
      I have a JS-function called getObjURL() which should return an URL-
      String of an JS-object.
      >
      In the body part I use something like this:
      >
      <a href="../mystaticlink.ht m?parameter=jav ascript:getObjU RL()"
      target="_blank" ...>Linktext</a>
      >
      but this doesn't work.
      I also tried:
      <a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
      target="_blank" ...>Linktext</a>
      <a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
      target="_blank" ...>Linktext</a>
      ... and some other stupid things.
      >
      Could you please help me out of this?! Will it ever work or do I have
      to use other web-technologies to create my dynamic link?
      >
      Best regards,
      Schuessi
      >
      Hello Schuessi.
      try this..
      >
      <script language="JavaS cript" type="text/javascript">
      function getParam() {
          return 'first';}
      >
      function getLink() {
          document.getEle mentById('link' ).href= 'mystaticlink.h tm?
      parameter=' + getParam();}
      >
      </script>
      <a href="#" onclick="getLin k();" id="link">First </a>
      This works great, thank you!

      Comment

      • David Mark

        #4
        Re: a href with static and dynamic content using JavaScript

        On Oct 29, 6:48 am, Suhas Dhoke <suhasdh...@gma il.comwrote:
        On Oct 29, 3:31 pm, schuessi <schuessmas...@ googlemail.comw rote:
        >
        >
        >
        Hello all
        >
        I'm quite new to web development, so please be kind ;)
        >
        I have a JS-function called getObjURL() which should return an URL-
        String of an JS-object.
        >
        In the body part I use something like this:
        >
        <a href="../mystaticlink.ht m?parameter=jav ascript:getObjU RL()"
        target="_blank" ...>Linktext</a>
        >
        but this doesn't work.
        I also tried:
        <a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
        target="_blank" ...>Linktext</a>
        <a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
        target="_blank" ...>Linktext</a>
        ... and some other stupid things.
        >
        Could you please help me out of this?! Will it ever work or do I have
        to use other web-technologies to create my dynamic link?
        >
        Best regards,
        Schuessi
        >
        Hello Schuessi.
        try this..
        >
        <script language="JavaS cript" type="text/javascript">
        Don't use the language attribute.
        function getParam() {
            return 'first';}
        >
        function getLink() {
            document.getEle mentById('link' ).href= 'mystaticlink.h tm?
        parameter=' + getParam();}
        >
        </script>
        <a href="#" onclick="getLin k();" id="link">First </a>
        Ridiculous and inaccessible (whatever it is supposed to do.)

        Comment

        • David Mark

          #5
          Re: a href with static and dynamic content using JavaScript

          On Oct 29, 7:32 am, schuessi <schuessmas...@ googlemail.comw rote:
          On 29 Okt., 11:48, Suhas Dhoke <suhasdh...@gma il.comwrote:
          >
          >
          >
          On Oct 29, 3:31 pm, schuessi <schuessmas...@ googlemail.comw rote:
          >
          Hello all
          >
          I'm quite new to web development, so please be kind ;)
          >
          I have a JS-function called getObjURL() which should return an URL-
          String of an JS-object.
          >
          In the body part I use something like this:
          >
          <a href="../mystaticlink.ht m?parameter=jav ascript:getObjU RL()"
          target="_blank" ...>Linktext</a>
          >
          but this doesn't work.
          I also tried:
          <a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
          target="_blank" ...>Linktext</a>
          <a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
          target="_blank" ...>Linktext</a>
          ... and some other stupid things.
          >
          Could you please help me out of this?! Will it ever work or do I have
          to use other web-technologies to create my dynamic link?
          >
          Best regards,
          Schuessi
          >
          Hello Schuessi.
          try this..
          >
          <script language="JavaS cript" type="text/javascript">
          function getParam() {
              return 'first';}
          >
          function getLink() {
              document.getEle mentById('link' ).href= 'mystaticlink.h tm?
          parameter=' + getParam();}
          >
          </script>
          <a href="#" onclick="getLin k();" id="link">First </a>
          >
          This works great, thank you!
          No it doesn't. You have been advised to do something stupid. Agents
          without script or with script disabled will feature a link that does
          nothing.

          If you can explain just what it is you are trying to do, perhaps you
          will get some competent advice.

          Comment

          • David Mark

            #6
            Re: a href with static and dynamic content using JavaScript

            On Oct 29, 6:31 am, schuessi <schuessmas...@ googlemail.comw rote:
            Hello all
            >
            I'm quite new to web development, so please be kind ;)
            If you are new to Web development, then why are you trying to write
            scripted enhancements. You should concentrate on creating proper
            static documents first. Worry about scripting later.
            >
            I have a JS-function called getObjURL() which should return an URL-
            String of an JS-object.
            A what of a what? This is what I am talking about. You are jumping
            in with both feet before you know what you are getting into.
            >
            In the body part I use something like this:
            >
            <a href="../mystaticlink.ht m?parameter=jav ascript:getObjU RL()"
            target="_blank" ...>Linktext</a>
            >
            but this doesn't work.
            Which is hardly surprising. What made you think it would?
            I also tried:
            <a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
            target="_blank" ...>Linktext</a>
            Programming by trial and error is not recommended.
            <a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
            You are officially lost.
            target="_blank" ...>Linktext</a>
            ... and some other stupid things.
            Why are you wasting time with stupid things? Have you tried reading
            about the subject?
            >
            Could you please help me out of this?! Will it ever work or do I have
            to use other web-technologies to create my dynamic link?
            >
            I haven't the slightest idea what you are trying to do here.

            Comment

            • sasuke

              #7
              Re: a href with static and dynamic content using JavaScript

              On Oct 30, 5:55 am, David Mark <dmark.cins...@ gmail.comwrote:
              On Oct 29, 6:31 am, schuessi <schuessmas...@ googlemail.comw rote:
              >
              Hello all
              >
              I'm quite new to web development, so please be kind ;)
              >
              If you are new to Web development, then why are you trying to write
              scripted enhancements. You should concentrate on creating proper
              static documents first. Worry about scripting later.
              >
              >
              >
              I have a JS-function called getObjURL() which should return an URL-
              String of an JS-object.
              >
              A what of a what? This is what I am talking about. You are jumping
              in with both feet before you know what you are getting into.
              >
              >
              >
              In the body part I use something like this:
              >
              <a href="../mystaticlink.ht m?parameter=jav ascript:getObjU RL()"
              target="_blank" ...>Linktext</a>
              >
              but this doesn't work.
              >
              Which is hardly surprising. What made you think it would?
              >
              I also tried:
              <a href="../mystaticlink.ht m?parameter="+j avascript:getOb jURL()
              target="_blank" ...>Linktext</a>
              >
              Programming by trial and error is not recommended.
              >
              <a href="../mystaticlink.ht m?parameter=<%j avascript:getOb jURL()%>"
              >
              You are officially lost.
              >
              target="_blank" ...>Linktext</a>
              ... and some other stupid things.
              >
              Why are you wasting time with stupid things? Have you tried reading
              about the subject?
              >
              >
              >
              Could you please help me out of this?! Will it ever work or do I have
              to use other web-technologies to create my dynamic link?
              >
              I haven't the slightest idea what you are trying to do here.
              I wonder if we will get any reply on this one taking into
              consideration that the OP just uttered the magic words; *it
              works*. :-)

              ../sasuke

              Comment

              • Gregor Kofler

                #8
                Re: a href with static and dynamic content using JavaScript

                sasuke meinte:
                >I haven't the slightest idea what you are trying to do here.
                >
                I wonder if we will get any reply on this one taking into
                consideration that the OP just uttered the magic words; *it
                works*. :-)
                Another webpage atrocity meets the public. And I suppose the "solution"
                gets copied thousands of times.

                Gregor

                Comment

                • David Mark

                  #9
                  Re: a href with static and dynamic content using JavaScript

                  On Oct 30, 10:37 am, Gregor Kofler <use...@gregork ofler.atwrote:
                  sasuke meinte:
                  >
                  I haven't the slightest idea what you are trying to do here.
                  >
                  I wonder if we will get any reply on this one taking into
                  consideration that the OP just uttered the magic words; *it
                  works*. :-)
                  >
                  Another webpage atrocity meets the public. And I suppose the "solution"
                  gets copied thousands of times.
                  Of course. I wonder what the blind community thinks of the Web. A
                  useless compendium of random gibberish? Google's excuse is they
                  "can't please everyone." It should be illegal (and is in some
                  countries, IIRC.) Perhaps that is the only way to take Website
                  development out of the hands of incompetents.

                  Comment

                  • rf

                    #10
                    Re: a href with static and dynamic content using JavaScript


                    "David Mark" <dmark.cinsoft@ gmail.comwrote in message
                    news:0622f913-40d5-4921-bb1a-220c81dd9858@x4 1g2000hsb.googl egroups.com...
                    On Oct 30, 10:37 am, Gregor Kofler <use...@gregork ofler.atwrote:
                    >Another webpage atrocity meets the public. And I suppose the "solution"
                    >gets copied thousands of times.
                    >Of course. I wonder what the blind community thinks of the Web. A
                    >useless compendium of random gibberish? Google's excuse is they
                    >"can't please everyone." It should be illegal (and is in some
                    >countries, IIRC.)




                    Comment

                    • David Mark

                      #11
                      Re: a href with static and dynamic content using JavaScript

                      On Oct 30, 8:47 pm, "rf" <r...@invalid.c omwrote:
                      "David Mark" <dmark.cins...@ gmail.comwrote in message
                      >
                      news:0622f913-40d5-4921-bb1a-220c81dd9858@x4 1g2000hsb.googl egroups.com...
                      On Oct 30, 10:37 am, Gregor Kofler <use...@gregork ofler.atwrote:
                      >
                      Another webpage atrocity meets the public. And I suppose the "solution"
                      gets copied thousands of times.
                      Of course.  I wonder what the blind community thinks of the Web.  A
                      useless compendium of random gibberish?  Google's excuse is they
                      "can't please everyone."  It should be illegal (and is in some
                      countries, IIRC.)
                      >
                      http://www.google.com.au/search?q=Maguire+vs+SOCOG
                      Good link. I can't understand why, with all of the special interest
                      groups out there, nobody has taken Google to court on their numerous
                      accessibility barriers. Maybe then their "engineers" (quotes indicate
                      I once talked to one about this subject and he was no engineer) will
                      get the point.

                      Comment

                      Working...