simple question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AnuSumesh
    New Member
    • Aug 2007
    • 96

    simple question

    Hi All,

    I know it is very simple question.

    what is the meanig of following code and how it works :

    [CODE=javascript]if (document.image s)
    {
    location.replac e(//some url);
    }
    else
    {
    location.href =//some url;
    }[/CODE]

    Regards,
    Anu
    Last edited by gits; Jan 23 '08, 07:24 AM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    hi ...

    i think document.images checks for IE and in that case the current href of the window will be replaced with a new one. even in all other cases ... but when using location.replac e() the page will not be saved in the local browser history ...

    kind regards

    Comment

    • AnuSumesh
      New Member
      • Aug 2007
      • 96

      #3
      Hi

      Thank you very much.
      One more question: Mozilla supports ActiveX controls ar not?

      Regards,
      Anu

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Originally posted by AnuSumesh
        what is the meanig of following code and how it works :

        [CODE=javascript]if (document.image s)
        {
        location.replac e(//some url);
        }
        else
        {
        location.href =//some url;
        }[/CODE]
        Surely, it'd make more sense to actually test for the method that you're going to use:
        [CODE=javascript]if (location.repla ce)
        {
        location.replac e(//some url);
        }
        else
        {
        location.href =//some url;
        }[/CODE]

        Comment

        • gits
          Recognized Expert Moderator Expert
          • May 2007
          • 5390

          #5
          Originally posted by AnuSumesh
          Hi

          Thank you very much.
          One more question: Mozilla supports ActiveX controls ar not?

          Regards,
          Anu
          no it don't :) ... fortunatly mozilla don't support that ms-proprietary and security-risky component-model ...

          kind regards

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Originally posted by AnuSumesh
            One more question: Mozilla supports ActiveX controls ar not?
            There is the Mozilla ActiveX project, but it's not been updated since 1.5 and you can only use it for the specified browser version.

            Comment

            • AnuSumesh
              New Member
              • Aug 2007
              • 96

              #7
              Thanks to all

              Anu

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                You're welcome.

                Comment

                Working...