Pop up with strange behaviour in Internet Explorer but not Firefox.

Discussion in 'Javascript' started by ft310, May 29, 2007.

  1. ft310

    ft310 Guest

    Use Internet Explorer go to http://rhodeisland-aa.org/tester/meetings/index.htm

    On the left click "and go to meetings"

    Click any address in the right hand 'location' column.

    The entire page reloads in the frame. (Bad)

    Perform the same test using Firefox

    The entire page does not reload. (Good)

    In both cases the disclaimer window appears and the application
    continues. That is good, but the IE behaviour is not good.

    I know I am doing something wrong -- please tell me.

    Thank you.
    ft310, May 29, 2007
    #1
    1. Advertising

  2. ft310

    Guest

    I'm using FF2 and the entire page does reload too.
    , May 30, 2007
    #2
    1. Advertising

  3. ft310

    Guest

    Pay no attention to what I wrote earlier. You are right.
    , May 30, 2007
    #3
  4. ft310

    Guest

    Ok. This is what you have to do. Put something in the href="";
    otherwhise, IE will fill it for you to http://rhodeisland-aa.org/tester/meetings/,
    which will cause the entire page to reload.

    But. It seems like FF is replacing it with the current URL in the
    address bar.

    Put something like href="#".
    , May 30, 2007
    #4
  5. ft310

    Lee Guest

    said:
    >
    >Ok. This is what you have to do. Put something in the href="";
    >otherwhise, IE will fill it for you to
    >http://rhodeisland-aa.org/tester/meetings/,
    >which will cause the entire page to reload.
    >
    >But. It seems like FF is replacing it with the current URL in the
    >address bar.
    >
    >Put something like href="#".


    More important is that the onclick handler return false, so the
    browser doesn't try to follow the link.

    <a href="#NoLuckIfScriptDisabled"
    onclick="launch(610);return false">Sturdy Hospital Auditorium, 211 Park Street
    02703</a>


    --
    Lee, May 30, 2007
    #5
  6. ft310

    ft310 Guest

    On May 29, 9:57 pm, Lee <> wrote:
    > said:
    >
    >
    >
    > >Ok. This is what you have to do. Put something in the href="";
    > >otherwhise, IE will fill it for you to
    > >http://rhodeisland-aa.org/tester/meetings/,
    > >which will cause the entire page to reload.

    >
    > >But. It seems like FF is replacing it with the current URL in the
    > >address bar.

    >
    > >Put something like href="#".

    >
    > More important is that the onclick handler return false, so the
    > browser doesn't try to follow the link.
    >
    > <a href="#NoLuckIfScriptDisabled"
    > onclick="launch(610);return false">Sturdy Hospital Auditorium, 211 Park Street
    > 02703</a>
    >
    > --


    Thank you - this is great.

    Are you using some debugger to get this or is it just a superior
    development of your craft?


    Thanks

    Frank Toohey
    ft310, May 30, 2007
    #6
  7. ft310

    ft310 Guest

    On May 30, 12:27 am, Randy Webb <> wrote:
    > ft310 said the following on 5/29/2007 11:15 PM:
    >
    >
    >
    > > On May 29, 9:57 pm, Lee <> wrote:
    > >> said:

    >
    > >>> Ok. This is what you have to do. Put something in the href="";
    > >>> otherwhise, IE will fill it for you to
    > >>>http://rhodeisland-aa.org/tester/meetings/,
    > >>> which will cause the entire page to reload.
    > >>> But. It seems like FF is replacing it with the current URL in the
    > >>> address bar.
    > >>> Put something like href="#".
    > >> More important is that the onclick handler return false, so the
    > >> browser doesn't try to follow the link.

    >
    > >> <a href="#NoLuckIfScriptDisabled"
    > >> onclick="launch(610);return false">Sturdy Hospital Auditorium, 211 Park Street
    > >> 02703</a>

    >
    > >> --

    >
    > > Thank you - this is great.

    >
    > > Are you using some debugger to get this or is it just a superior
    > > development of your craft?

    >
    > It is a superior development of the craft with some sorcery thrown in
    > for fun. It can be learned from the group FAQ and the archives though.
    > Personally, I don't care for the onclick="launch(160);return false", I
    > prefer onclick="return launch(160)" and let the launch function return
    > true or false. You can search the archives to find out why return
    > functionName is a better alternative.
    >
    > --
    > Randy
    > Chance Favors The Prepared Mind
    > comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
    > Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/


    Randy Again thanks -- love your answer -- it you got it . . .

    The hint about the return will be implemented immediately.
    ft310, May 30, 2007
    #7
  8. ft310

    -Lost Guest

    Randy Webb wrote:
    >> Are you using some debugger to get this or is it just a superior
    >> development of your craft?

    >
    > It is a superior development of the craft with some sorcery thrown in
    > for fun. It can be learned from the group FAQ and the archives though.
    > Personally, I don't care for the onclick="launch(160);return false", I
    > prefer onclick="return launch(160)" and let the launch function return
    > true or false. You can search the archives to find out why return
    > functionName is a better alternative.


    Could you perhaps provide a search string to that effect?

    I tried "return functionName" just in case, and well, it was not
    satisfactory to say the least.

    I am quite happy to know that I already subscribed to this method of
    coding though. Why it is necessarily better I do not know. I did it
    because it just made sense to reduce clutter in your markup and two,
    because, why not have the function do it for you?

    --
    -Lost
    Remove the extra words to reply by e-mail. Don't e-mail me. I am
    kidding. No I am not.
    -Lost, May 30, 2007
    #8
  9. ft310

    -Lost Guest

    Randy Webb wrote:
    > Randy Webb said the following on 5/30/2007 12:46 PM:
    >> -Lost said the following on 5/30/2007 11:23 AM:
    >>> Randy Webb wrote:
    >>>>> Are you using some debugger to get this or is it just a superior
    >>>>> development of your craft?
    >>>>
    >>>> It is a superior development of the craft with some sorcery thrown
    >>>> in for fun. It can be learned from the group FAQ and the archives
    >>>> though. Personally, I don't care for the onclick="launch(160);return
    >>>> false", I prefer onclick="return launch(160)" and let the launch
    >>>> function return true or false. You can search the archives to find
    >>>> out why return functionName is a better alternative.
    >>>
    >>> Could you perhaps provide a search string to that effect?

    >>
    >> I could probably come up with one if I searched and looked long
    >> enough. It is quicker and easier to explain it though.
    >>
    >>> I tried "return functionName" just in case, and well, it was not
    >>> satisfactory to say the least.
    >>>
    >>> I am quite happy to know that I already subscribed to this method of
    >>> coding though. Why it is necessarily better I do not know.

    >>
    >> Then why do you use a method that you don't know why it is better? :)


    Firstly, sorry for the *extremely* delayed response. I forgot the name
    of the thread and had a bit of a family issue so didn't check the groups
    for several days.

    Little did I know that so many new replies would appear and make me lose
    my place.

    I eventually searched for "return functionName." ;)

    Anyway, in response, because I developed what I thought was a clear
    understanding of better coding practices.

    >>> I did it because it just made sense to reduce clutter in your markup
    >>> and two, because, why not have the function do it for you?

    >>
    >> In this code:
    >>
    >> onclick="someFunction();return false"
    >>
    >> If someFunction has a coding error in it where it causes an error,
    >> then the return false never gets executed and the browser will
    >> navigate to the href property of the A element. With this code:


    Ah, I never thought (or knew) about that.

    >> onclick="return someFunction()"
    >>
    >> If someFunction has an error in it then it essentially returns false
    >> (I believe it actually ends up as return null which type converts to
    >> return false) and cancels the navigation.
    >>
    >> Makes debugging a lot easier when the browser isn't navigating away on
    >> you.


    Ah, OK. So by not firing the default link *and* your function does
    nothing you realize it was the function itself that went afoul.

    Never thought about that either.

    > I like replying to myself so much I had to do it again:
    >
    > <a href="thisPageRequiresActiveX.html" onclick="return
    > doSomething()">Something useless as usual goes here</a>
    >
    > function doSomething(){
    > if (window.activeX){
    > //do something insane with activeX
    > return false
    > }
    > return true
    > }


    Oooo. Internet Explorer-only functions huh? Tsk tsk tsk.

    Also, you did mean window.ActiveXObject right? Otherwise, I am lost.
    (Get it, I am lost? Ha!)

    Speaking of proper coding practices, which is better?:

    function f1()
    {
    if (window.ActiveXObject)
    {
    // do ActiveX
    return false; // don't follow link
    }
    return true;
    }

    function f2()
    {
    if (window.ActiveXObject)
    {
    // do ActiveX
    return false; // don't follow link
    }
    else
    {
    return true;
    }
    }

    I certainly like f1() better.

    > I should start taking sleeping pills again.


    Would Mr. Webb like some of -Lost's Seroquel? I have 300mg tablets.
    Unless you are my size, that will put you to sleep for nigh on 16 hours.

    --
    -Lost
    Remove the extra words to reply by e-mail. Don't e-mail me. I am
    kidding. No I am not.
    -Lost, Jun 5, 2007
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joker7
    Replies:
    6
    Views:
    6,792
    Joker7
    Apr 1, 2005
  2. Ed Hauptman
    Replies:
    7
    Views:
    984
    Ed Hauptman
    Aug 7, 2009
  3. Usman
    Replies:
    3
    Views:
    95
    chotchki
    Oct 12, 2003
  4. Heiko Pliefke
    Replies:
    1
    Views:
    110
    Lasse Reichstein Nielsen
    Feb 11, 2004
  5. gray_slp
    Replies:
    3
    Views:
    113
    Geoffrey Summerhayes
    Jun 27, 2007
Loading...

Share This Page