my script doesn't work.... sigh!

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

    my script doesn't work.... sigh!

    About one month ago I have inserted in my web site a
    clickcounter who controls the access to almost every link, but this script
    who changed the path in every link so the
    search engines couldn't recognize my links and my web site has lost a lot in
    search engines ranks;
    this is the script:


    <A href="http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://www.fiao.it"
    Target="_blank" >
    F.I.A.O.
    </A>

    <p class=notasxinf >
    <script
    src="http://www.mywebsite.c om/cgi-bin/click/stats.cgi?url=h ttp://www.fiao.it
    &type=js"> <!this script send the number to the counter>
    </script>
    accessi dal 13/12/2003
    </p>

    Last week a person said to me to insert this javascript to solve all off my
    problems (I'm a javascript begginner):


    <a href="http://www.fiao.it" (here I added: target="_blank" )
    onclick="self.l ocation.href='h ttp://www.mywebsite.c om/cgi-bin/click/go.cgi?h
    ttp://www.fiao.it'; return false">
    FIAO.it </A>
    and to mantein the other script:

    <p class=notasxinf >
    <script
    src="http://www.mywebsite.c om/cgi-bin/click/stats.cgi?url=h ttp://www.fiao.it
    &type=js"> <!this script send the number to the counter>
    </script>
    accessi dal 13/12/2003
    </p>

    Whith this script though I have added: target="_blank" , i couldn't raise to
    have the second window opened so I changed a little the javascript (I'm a
    javascript begginner) in this way:

    <a href="http://www.fiao.it" target="_blank"
    onclick="window .open(self.loca tion.href='http ://www.mywebsite.c om/cgi-bin/cl
    ick/go.cgi?http://www.fiao.it'; return false)">
    FIAO
    </A>

    at the beginning it looks to work, so I inserted it in almost all my site
    (working hard during two days), but half an hour ago I have discovered it
    doesn't work:
    Now a new window open, but the counter does not count!!!
    Every one can say to me where is the error in this last my script, or better
    which script I need to use to obtain the result to count clicks, to open the
    site in a new window and to left a copy of the link that could be read by
    search engine (possibly without using the noscript tag)?

    thanks lot to every who answer this may question
    bye luca (from Italy).








  • Luca

    #2
    Re: my script doesn't work.... sigh!

    Is this so difficult? :-)

    "Luca" <drywaterfallNO SPAM@hotmail.co m> ha scritto nel messaggio
    news:m4wTb.8587 $Mt6.338726@twi ster2.libero.it ...[color=blue]
    > About one month ago I have inserted in my web site a
    > clickcounter who controls the access to almost every link, but this script
    > who changed the path in every link so the
    > search engines couldn't recognize my links and my web site has lost a lot[/color]
    in[color=blue]
    > search engines ranks;
    > this is the script:
    >
    >
    > <A[/color]
    href="http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://www.fiao.it"[color=blue]
    > Target="_blank" >
    > F.I.A.O.
    > </A>
    >
    > <p class=notasxinf >
    > <script
    >[/color]
    src="http://www.mywebsite.c om/cgi-bin/click/stats.cgi?url=h ttp://www.fiao.it[color=blue]
    > &type=js"> <!this script send the number to the counter>
    > </script>
    > accessi dal 13/12/2003
    > </p>
    >
    > Last week a person said to me to insert this javascript to solve all off[/color]
    my[color=blue]
    > problems (I'm a javascript begginner):
    >
    >
    > <a href="http://www.fiao.it" (here I added: target="_blank" )
    >[/color]
    onclick="self.l ocation.href='h ttp://www.mywebsite.c om/cgi-bin/click/go.cgi?h[color=blue]
    > ttp://www.fiao.it'; return false">
    > FIAO.it </A>
    > and to mantein the other script:
    >
    > <p class=notasxinf >
    > <script
    >[/color]
    src="http://www.mywebsite.c om/cgi-bin/click/stats.cgi?url=h ttp://www.fiao.it[color=blue]
    > &type=js"> <!this script send the number to the counter>
    > </script>
    > accessi dal 13/12/2003
    > </p>
    >
    > Whith this script though I have added: target="_blank" , i couldn't raise[/color]
    to[color=blue]
    > have the second window opened so I changed a little the javascript (I'm a
    > javascript begginner) in this way:
    >
    > <a href="http://www.fiao.it" target="_blank"
    >[/color]
    onclick="window .open(self.loca tion.href='http ://www.mywebsite.c om/cgi-bin/cl[color=blue]
    > ick/go.cgi?http://www.fiao.it'; return false)">
    > FIAO
    > </A>
    >
    > at the beginning it looks to work, so I inserted it in almost all my site
    > (working hard during two days), but half an hour ago I have discovered it
    > doesn't work:
    > Now a new window open, but the counter does not count!!!
    > Every one can say to me where is the error in this last my script, or[/color]
    better[color=blue]
    > which script I need to use to obtain the result to count clicks, to open[/color]
    the[color=blue]
    > site in a new window and to left a copy of the link that could be read by
    > search engine (possibly without using the noscript tag)?
    >
    > thanks lot to every who answer this may question
    > bye luca (from Italy).
    >
    >
    >
    >
    >
    >
    >
    >[/color]


    Comment

    • @SM

      #3
      Re: my script doesn't work.... sigh!



      Luca a ecrit :[color=blue]
      >
      > About one month ago I have inserted in my web site a
      > clickcounter who controls the access to almost every link, but this script
      > who changed the path in every link so the
      > search engines couldn't recognize my links and my web site has lost a lot in
      > search engines ranks;
      > this is the script:
      >
      > <A href="http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://www.fiao.it"
      > Target="_blank" >
      > F.I.A.O.
      > </A>
      >
      > <p class=notasxinf >
      > <script
      > src="http://www.mywebsite.c om/cgi-bin/click/stats.cgi?url=h ttp://www.fiao.it
      > &type=js"> <!this script send the number to the counter>
      > </script>
      > accessi dal 13/12/2003
      > </p>
      >
      > Last week a person said to me to insert this javascript to solve all off my
      > problems (I'm a javascript begginner):
      >
      > <a href="http://www.fiao.it" (here I added: target="_blank" )
      > onclick="self.l ocation.href='h ttp://www.mywebsite.c om/cgi-bin/click/go.cgi?h
      > ttp://www.fiao.it'; return false">
      > FIAO.it </A>
      > and to mantein the other script:
      >
      > <p class=notasxinf >
      > <script
      > src="http://www.mywebsite.c om/cgi-bin/click/stats.cgi?url=h ttp://www.fiao.it
      > &type=js"> <!this script send the number to the counter>
      > </script>
      > accessi dal 13/12/2003
      > </p>
      >
      > Whith this script though I have added: target="_blank" , i couldn't raise to
      > have the second window opened so I changed a little the javascript (I'm a
      > javascript begginner) in this way:
      >
      > <a href="http://www.fiao.it" target="_blank"
      > onclick="window .open(self.loca tion.href='http ://www.mywebsite.c om/cgi-bin/cl
      > ick/go.cgi?http://www.fiao.it'; return false)">
      > FIAO
      > </A>
      >
      > at the beginning it looks to work, so I inserted it in almost all my site
      > (working hard during two days), but half an hour ago I have discovered it
      > doesn't work:
      > Now a new window open, but the counter does not count!!!
      > Every one can say to me where is the error in this last my script, or better
      > which script I need to use to obtain the result to count clicks, to open the
      > site in a new window and to left a copy of the link that could be read by
      > search engine (possibly without using the noscript tag)?
      >
      > thanks lot to every who answer this may question
      > bye luca (from Italy).[/color]

      Do not understand why you want to open in a new window ... ? !
      Perhaps is it why it doesn't work ?
      You call a cgi and you don't know how it runs !
      It would be preferable to do not open it in a new window.
      Certainly on fiao.it they have a FAQ about their counter.
      Try to do exactly what they say, before to test other ways ... !

      in your code to open a new window there are some mistakes :

      Correct it like that :

      <a href="http://www.fiao.it" target="_blank"
      onclick="
      window.open('ht tp://www.mywebsite.c om/cgi-bin/click/go.cgi?http://www.fiao.it');
      return false;">FIAO</A>

      You could try :

      <a href="http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://www.fiao.it"
      target="vinivic i" onclick="window .open('','viniv ici');">FIAO</A>

      or :

      <a href="http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://www.fiao.it"
      target="vinivic i" onclick="window .open('','viniv ici','resizable =1,menubar=1'); ">FIAO</A>

      or (for a full screen) (very not recommanded ! )

      <a href="http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://www.fiao.it"
      target="vinivic i" onclick="window .open('','viniv ici','width='+
      screen.width-26+',height='+s creen.height-50+',resizable= 1,top=0,left=0' );">FIAO</A>

      --
      ******** (enlever/remove [OTER_MOI] du/from reply url) *******
      Stéphane MORIAUX : mailto:stephane OTER_MOImoriaux @wanadoo.fr
      Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)

      *************** *************** *************** *************** **

      Comment

      • Luca

        #4
        Re: my script doesn't work.... sigh!

        Thanks lot!!!
        I had already found the solution and it works:

        <a href="http://www.xyzwebsite. com/"
        onclick="window .open('http://mywebsite.com/cgi-bin/click/go.cgi?http://www.x
        yzwebsite.com/'); return false;">
        xyzwebsite</a>

        Can you tell me if this script could have any problem?

        thanks, bye
        Luca


        Comment

        • Michael Winter

          #5
          Re: my script doesn't work.... sigh!

          On Tue, 03 Feb 2004 15:16:07 GMT, Luca <drywaterfallNO SPAM@hotmail.co m>
          wrote:
          [color=blue]
          > <a href="http://www.xyzwebsite. com/"
          > onclick="window .open('http://mywebsite.com/cgi-bin/click/go.cgi?http://www.x
          > yzwebsite.com/'); return false;">
          > xyzwebsite</a>
          >
          > Can you tell me if this script could have any problem?[/color]

          The window.open() method requires two arguments. The first (which you
          have) is the URI of the document to load. The second is the name of the
          new window, which can be used with the target attribute in links. Even if
          you never intend to use the name, you should supply it - even 'w' would be
          fine. I think some browsers refuse to open the window if you don't.

          Mike

          --
          Michael Winter
          M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

          Comment

          • Luca

            #6
            Re: my script doesn't work.... sigh!

            [color=blue]
            > The window.open() method requires two arguments. The first (which you
            > have) is the URI of the document to load. The second is the name of the
            > new window, which can be used with the target attribute in links. Even if
            > you never intend to use the name, you should supply it - even 'w' would be
            > fine. I think some browsers refuse to open the window if you don't.[/color]


            So the script would be this? ---> (inserting target="_blank" )

            <a href="http://www.xyzwebsite. com/" target="_blank"
            onclick="window .open('http://mywebsite.com/cgi-bin/click/go.cgi?http://www.x
            yzwebsite.com/'); return false;">
            xyzwebsite</a>

            if not what could be (sorry i'm a javascript beginner :-) )

            thanks, bye

            Luca



            Comment

            • Michael Winter

              #7
              Re: my script doesn't work.... sigh!

              On Tue, 03 Feb 2004 15:48:32 GMT, Luca <drywaterfallNO SPAM@hotmail.co m>
              wrote:
              [color=blue]
              > On Tue, 03 Feb 2004 15:19:51 GMT, Michael Winter
              > <M.Winter@bluey onder.co.invali d> wrote:
              >[color=green]
              >> The window.open() method requires two arguments. The first (which you
              >> have) is the URI of the document to load. The second is the name of the
              >> new window, which can be used with the target attribute in links. Even
              >> if you never intend to use the name, you should supply it - even 'w'
              >> would be fine. I think some browsers refuse to open the window if you
              >> don't.[/color]
              >
              > So the script would be this? ---> (inserting target="_blank" )
              >
              > <a href="http://www.xyzwebsite. com/" target="_blank"
              > onclick="window .open('http://mywebsite.com/cgi-bin/click/go.cgi?http://www.x
              > yzwebsite.com/'); return false;">
              > xyzwebsite</a>
              >
              > if not what could be (sorry i'm a javascript beginner :-) )[/color]

              The HTML is fine. I was referring to the JavaScript call. You currently
              have

              window.open('UR L');

              What you need is

              window.open('UR L', 'windowName');

              So, using your current example (omitting the URL for clarity), we have:

              <a href="http://www.xyzwebsite. com/"
              onclick="window .open('theURL', 'xyzwebsite'); return false">...</a>

              If you did want to direct a page opened by a link to the new window, you
              could do:

              <a href="http://www.example.com/" target="xyzwebs ite">...</a>

              Notice that the values of the target attribute, and the second argument to
              window.open(), are the same.

              Mike

              --
              Michael Winter
              M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

              Comment

              • Luca

                #8
                Re: my script doesn't work.... sigh!

                > Notice that the values of the target attribute, and the second argument to[color=blue]
                > window.open(), are the same.[/color]


                So I need to use both target="_Newwin dow" and the second argumento of
                window.open ?

                <a href="http://www.xyzwebsite. com/" target="_Newwin dow"
                onclick="window .open('theURL', 'xyzwebsite'); return false">...</a>

                or is enough:


                <a href="http://www.xyzwebsite. com/"
                onclick="window .open('theURL', 'xyzwebsite'); return false">...</a>


                And I 've seen a little particular in your script:

                I need to remove the semicolon at the end of the script? ----> ); return
                false;">...</a> to make so (i had read is better to put it there) : ---> );
                return false">..</a>
                thanks, bye
                luca






                Comment

                • Luca

                  #9
                  Re: my script doesn't work.... sigh!

                  > Notice that the values of the target attribute, and the second argument to[color=blue]
                  > window.open(), are the same.[/color]


                  So I need to use both target="_Newwin dow" and the second argumento of
                  window.open ?

                  <a href="http://www.xyzwebsite. com/" target="_Newwin dow"
                  onclick="window .open('theURL', 'xyzwebsite'); return false">...</a>

                  or is enough:


                  <a href="http://www.xyzwebsite. com/"
                  onclick="window .open('theURL', 'xyzwebsite'); return false">...</a>


                  And I 've seen a little particular in your script:

                  I need to remove the semicolon at the end of the script? ----> ); return
                  false;">...</a> to make so (i had read is better to put it there) : ---> );
                  return false">..</a>
                  thanks, bye
                  luca








                  Comment

                  • Michael Winter

                    #10
                    Re: my script doesn't work.... sigh!

                    On Tue, 03 Feb 2004 16:30:15 GMT, Luca <drywaterfallNO SPAM@hotmail.co m>
                    wrote:
                    [color=blue][color=green]
                    >> Notice that the values of the target attribute, and the second argument
                    >> to window.open(), are the same.[/color][/color]

                    Sorry, I shouldn't have introduced the target attribute to the discussion.
                    [color=blue]
                    > So I need to use both target="_Newwin dow" and the second argumento of
                    > window.open ?
                    >
                    > <a href="http://www.xyzwebsite. com/" target="_Newwin dow"
                    > onclick="window .open('theURL', 'xyzwebsite'); return false">...</a>
                    >
                    > or is enough:
                    >
                    > <a href="http://www.xyzwebsite. com/"
                    > onclick="window .open('theURL', 'xyzwebsite'); return false">...</a>[/color]

                    The second example (without the target attribute) is sufficient.

                    [color=blue]
                    > And I 've seen a little particular in your script:
                    >
                    > I need to remove the semicolon at the end of the script?[/color]

                    No, you don't. I just tend to. In an intrinsic event, you don't need to
                    include a semi-colon at the end of the last statement, but it is good
                    practice to add it. With scripts in general, you should always terminate
                    statements with a semi-colon.

                    Mike

                    --
                    Michael Winter
                    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

                    Comment

                    • Luca

                      #11
                      Re: my script doesn't work.... sigh!

                      I have inserted your suggestion in part of my today work and when I click on
                      the links the editor html said there is an error in the script:
                      The script I have tried now is this:

                      <a href="http://www.assoleader. it" target="_blank"
                      onclick="window .open('http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://w
                      ww.assoleader.i t', '_blank'); return false;">
                      www.Assoleader.it .</A>

                      My html editor says there is an error at first letter of the line --->
                      onclick=....

                      I have also tried without target="_blank" and without the secon argument of
                      window.open. in all these cases the editor I use says there is an error in
                      javascript code.

                      I don't know what to do: now i'm thinking to leave all in the same manner it
                      was:

                      <a href="http://www.assoleader. it"
                      onclick="window .open('http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://w
                      ww.assoleader.i t'); return false;">
                      www.Assoleader.it .</A>


                      bye ,
                      Luca








                      Comment

                      • Luca

                        #12
                        Re: my script doesn't work.... sigh!

                        Sorry i hadn't read your last message, but I must confirm that my editor
                        (first page2000 says theree is an error in the script) also with this kind
                        of script (though the script
                        works):

                        a href="http://www.xyzwebsite. com/"
                        onclick="window .open('theURL', 'xyzwebsite'); return false">...</a>

                        so i don't know what to do!!?

                        thanks all the same,
                        Luca




                        Comment

                        • Michael Winter

                          #13
                          Re: my script doesn't work.... sigh!

                          On Tue, 03 Feb 2004 19:18:33 GMT, Luca <drywaterfallNO SPAM@hotmail.co m>
                          wrote:
                          [color=blue]
                          > Sorry i hadn't read your last message, but I must confirm that my editor
                          > (first page2000 says theree is an error in the script) also with this
                          > kind
                          > of script (though the script
                          > works):
                          >
                          > a href="http://www.xyzwebsite. com/"
                          > onclick="window .open('theURL', 'xyzwebsite'); return false">...</a>
                          >
                          > so i don't know what to do!!?[/color]

                          Create this as a HTML file. Tell me if you have problems with it.

                          <html lang="en" dir="ltr">
                          <head>
                          <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
                          <meta http-equiv="Content-Script-Type" content="text/javascript">
                          <title>Test page</title>
                          </head>
                          <body>
                          <div>
                          <a href="http://www.google.com/"
                          onclick="window .open(this.href ,'Google');retu rn false;">test</a>
                          </div>
                          </body>
                          </html>

                          Mike

                          Just so you know: using this.href as I did above is the same as using
                          'http://www.google.com/'

                          --
                          Michael Winter
                          M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

                          Comment

                          • Luca

                            #14
                            Re: my script doesn't work.... sigh!

                            I have tried what you said, but it looks be the same, but i think what you
                            say be the just thing because I have seen my editor tell me there is an
                            error when I'm off line (and it cannot tell me what kind of error!), but
                            when i'm on line, if I press a link in the editor, the referring web sites
                            open in a new window without problems... so i think maybe is a problem of my
                            editor.

                            I'm courious to understan something of your last message:
                            Can i put this href again after the script path, like this:

                            <a href="http://www.assoleader. it"
                            onclick="window .open('http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://t
                            his.href', 'w'); return false;">
                            www.Assoleader.it .</A> ?

                            Is it always necessary to put this in the "head" (I hadn't this (but whit,
                            or without I have seen no changes are):
                            <meta http-equiv="Content-Script-Type" content="text/javascript">
                            ?

                            However I'm very happy to have found you so patient!
                            thanks lot ,
                            bye,
                            Luca



                            Comment

                            • Luca

                              #15
                              Re: my script doesn't work.... sigh!

                              I have tried what you said, but it looks be the same, but i think what you
                              say be the just thing because I have seen my editor tell me there is an
                              error when I'm off line (and it cannot tell me what kind of error!), but
                              when i'm on line, if I press a link in the editor, the referring web sites
                              open in a new window without problems... so i think maybe is a problem of my
                              editor.

                              I'm courious to understan something of your last message:
                              Can i put this href again after the script path, like this:

                              <a href="http://www.assoleader. it"
                              onclick="window .open('http://www.mywebsite.c om/cgi-bin/click/go.cgi?http://t
                              his.href', 'w'); return false;">
                              www.Assoleader.it .</A> ?

                              Is it always necessary to put this in the "head" (I hadn't this (but whit,
                              or without I have seen no changes are):
                              <meta http-equiv="Content-Script-Type" content="text/javascript">
                              ?

                              However I'm very happy to have found you so patient!
                              thanks lot ,
                              bye,
                              Luca





                              Comment

                              Working...