Announcement

Collapse
No announcement yet.

how to prevent a page from opening on a new page?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to prevent a page from opening on a new page?

    Hi,
    A small question:
    I, as admin, posted a message with a link, but it opens on a new window.
    How do I fix that? I need it to replace the current window.

    Should I allow HTML for myself only? If yes, what would be the code I should use?

    Aslo in the issue:
    Is there any difference between Admin's post and Admin's Annoncements?

    thanks.

  • #2
    Open New Window:
    <a href="blahblah.com" target="_blank"> Blah Blah </a>

    Open On Same Window:
    <a href="blachblah.com"> Blah Blah </a>

    Comment


    • #3
      Thanks Pure Evil,

      How can I prevent it from adding <blank> to the URL thou?
      It adds it automatically as a suffix

      Comment


      • #4
        Hi

        If this is for forums then the target attribute is deprecated for xhtml anyway but it is still a part of the DOM (go figure) so, kill two birds with one stone:
        <a href="blahblah.com" onclick="this.target='_self'">Blah Blah</a>
        you could also stop the need to turn HTML on by making it a bbCode:
        [selflink=url]text[/selflink]
        Later
        Keith

        Webxpertz Community for Webmasters & Developers

        Comment


        • #5
          Originally posted by diades
          Hi

          If this is for forums then the target attribute is deprecated for xhtml anyway but it is still a part of the DOM (go figure) so, kill two birds with one stone:
          <a href="blahblah.com" onclick="this.target='_self'">Blah Blah</a>
          you could also stop the need to turn HTML on by making it a bbCode:
          [selflink=url]text[/selflink]
          hmm thanks,
          but I maybe kinda noob on html and as I see on other forums, most of them open pages on a new window.

          Can you elaborate on how can I open pages on the SAME window, please
          Maybe I need some exact instructions...

          TNX

          Comment


          • #6
            Hi total

            I just did:
            <a href="blahblah.com" onclick="this.target='_self'">Blah Blah</a>
            Later
            Keith

            Webxpertz Community for Webmasters & Developers

            Comment


            • #7
              Thanks!

              Originally posted by diades
              Hi total

              I just did:
              <a href="blahblah.com" onclick="this.target='_self'">Blah Blah</a>
              Thanks mate

              Comment


              • #8
                Originally posted by diades
                Hi

                If this is for forums then the target attribute is deprecated for xhtml anyway but it is still a part of the DOM (go figure) so, kill two birds with one stone:
                <a href="blahblah.com" onclick="this.target='_self'">Blah Blah</a>
                you could also stop the need to turn HTML on by making it a bbCode:
                [selflink=url]text[/selflink]
                I just saw this through a search... what version did selflink appear in? I'm a moderator on a site running 3.0.7 and the selflink tag doesn't seem to work from bbCode. To clarify I have no control over server-side code; I'm trying to make anchor links within a thread that keep the user in the same browser window.

                Comment


                • #9
                  You'd have to make the bbcode yourself

                  Comment


                  • #10
                    Originally posted by Zachery
                    You'd have to make the bbcode yourself
                    Is that to say there is no "selflink" tag, and the poster was suggesting creating a custom one on the vB install?

                    Comment


                    • #11
                      Yes.

                      Comment


                      • #12
                        no need for a bbcode
                        u can stop it with a simple replacement variable
                        replace
                        HTML Code:
                        " target="_blank">
                        with
                        HTML Code:
                        ">

                        Comment

                        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                        Working...
                        X