open link in a new window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dasrasmikant
    New Member
    • Jan 2008
    • 30

    open link in a new window

    hy,
    I want to open the link in a new window but I will not use
    Code:
    window.open
    method.
    So like
    Code:
    top.location.href, parent.location.href, self.location .href
    , is there any code for it .

    thanks in advance for your valuable responses
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Use target attribute.

    PS: Once you get your answer, you may say, "I got my answer".

    Comment

    • dasrasmikant
      New Member
      • Jan 2008
      • 30

      #3
      Originally posted by hsriat
      Use target attribute.

      PS: Once you get your answer, you may say to me, "I got my answer".
      but how can I set target attribute here. I think the target attribute can only use on <a> and <form> elements.

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Originally posted by dasrasmikant
        but how can I set target attribute here. I think the target attribute can only use on <a> and <form> elements.
        Yeah, If you don't want to use window.open, then use <a target="_blank" href="abc.htm">

        Is there any special reason for not using window.open?
        Pop up blockers..?

        Comment

        • dasrasmikant
          New Member
          • Jan 2008
          • 30

          #5
          Yes for pop up blocker problem.
          I cant use <a> tags because I want to go from a particular javascript function.

          Comment

          • hsriat
            Recognized Expert Top Contributor
            • Jan 2008
            • 1653

            #6
            Popup blockers don't block all the windows opened with window.open, but that depends upon the element onclick of whom you opened the window and how many windows you open simultaneously.
            Onclick of which element do you want to open the window?

            Also, there is no other way out for that. Just think, if there were some other way, would the FF development team be not aware of that to update their popup blocker?
            (I don't talk about IE, there can be a possibility that they are unaware of any such thing :p)


            Regards,
            Harpreet

            Comment

            • dasrasmikant
              New Member
              • Jan 2008
              • 30

              #7
              Originally posted by hsriat
              Popup blockers don't block all the windows opened with window.open, but that depends upon the element onclick of whom you opened the window and how many windows you open simultaneously.
              Onclick of which element do you want to open the window?
              Thanks for your responses
              I am calling function by onclick events of a input button.
              so can you share me the list of elements on which popup blocker works.

              and what is code in window.open method for opening a new window with all bars ie address bars, menu bars, status bars etc

              Comment

              • hsriat
                Recognized Expert Top Contributor
                • Jan 2008
                • 1653

                #8
                Originally posted by dasrasmikant
                I am calling function by onclick events of a input button.
                Input button is not meant for that purpose, so it will get blocked. You may use <button> for the same. It wont get blocked (I think).
                Originally posted by dasrasmikant
                so can you share me the list of elements on which popup blocker works.
                I don't have that list. I just know few on them. Blockers work on input, and img and they don't work on a (sometimes and if href is blank) and button.
                Originally posted by dasrasmikant
                and what is code in window.open method for opening a new window with all bars ie address bars, menu bars, status bars etc
                Here is the information on it.

                Regards

                Comment

                Working...