How to hide link's url?

Discussion in 'JavaScript' started by Betty_S, Feb 1, 2007.

  1. #1
    Hi everyone,

    I can't use html forms so I can't use[ 'method=post'].

    Instead, I use [window location="…";]. I'm using the url to pass parameters, how can I hide them or hide the whole link?

    Thanks in advance.
     
    Betty_S, Feb 1, 2007 IP
  2. ancer

    ancer Well-Known Member

    Messages:
    302
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    128
    #2
    Hi. I use this script.

    <script>

    //Hide status bar msg script- by javascriptkit.com
    //Visit JavaScript Kit (http://javascriptkit.com) for script
    //Credit must stay intact for use

    //configure status message to show
    var statusmsg=""

    function hidestatus(){
    window.status=statusmsg
    return true
    }

    </script>

    at each link do this

    <a href = 'http://www.abc.com' onMouseover="return hidestatus()">

    Hope this helps.
     
    ancer, Feb 2, 2007 IP
  3. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #3
    Did you mean hide the status bar message?
    Use the code below if yes.
    	<script>
    function hidestatus(){
    window.status=''
    return true
    }
    
    if (document.layers)
    document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)
    
    document.onmouseover=hidestatus
    document.onmouseout=hidestatus
    </script>
    Code (markup):
     
    Richie_Ni, Feb 2, 2007 IP
  4. ancer

    ancer Well-Known Member

    Messages:
    302
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    128
    #4
    yeah... and that one too...
    Thanks Richie_Ni
     
    ancer, Feb 2, 2007 IP
  5. Betty_S

    Betty_S Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks but I meant to hide the link in the address bar so the user can see the passed parameters. I want to remind you that I'm not using a form so I can't use the post method.

    TKS IN ADVNS
     
    Betty_S, Feb 4, 2007 IP
  6. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #6
    Hide the link in the address bar or status bar?
    What do you mean by?:confused:
    Can you tell me what do you want to do?
     
    Richie_Ni, Feb 4, 2007 IP
  7. matt9b

    matt9b Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    tried this script and the other one, neither of them work. any ideas?
     
    matt9b, Dec 31, 2008 IP
  8. chiquito

    chiquito Well-Known Member

    Messages:
    482
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    123
    #8
    thanks i used this way:

    <style type="text/css">
    a.hidden
    {
    display: none;
    }
    </style>
    <p class="x_hide"><a href="http://site.com" class="hidden" id="myHiddenClass">BLABLABLA</a></p>

    But i have a question how to make it to be in top header, super top???!
     
    chiquito, Jan 10, 2010 IP
  9. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #9
    I understand what you mean.. why can't you use a form? You can use AJAX to 'POST' the data, and then display a response. Alternatively, you could use javascript to create a FORM element, add all your elements that you want to submit and then run the submit() method. Which would hide the querystring (which i think is what you want). For example:
    
    <input id="txt1" name="txt1" type="text" /><br />
    <input id="txt2" name="txt2" type="text" /><br />
    <input id="btnSubmit" type="button" value="Submit" />
    <script type="text/javascript" >
        document.getElementById("btnSubmit").onclick = function() {
            var myForm = document.createElement("form");
            myForm.appendChild(document.getElementById("txt1"));
            myForm.appendChild(document.getElementById("txt2"));
            myForm.method = "POST"
            myForm.action = "MyHandler.php";
            myForm.style.display = "none";
            document.body.appendChild(myForm);
            myForm.submit();
        }
    </script>
    
    Code (markup):
    If you have a few inputs then you could just place them within a DIV and add all the elements from that div to the form you created to shorten the code.

    (sorry, didn't realise the age of this thread until then)
     
    Last edited: Jan 13, 2010
    camjohnson95, Jan 13, 2010 IP
  10. Andy_ameed

    Andy_ameed Active Member

    Messages:
    129
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #10
    it can be hidden using javascript and then using css.
     
    Andy_ameed, Jan 14, 2010 IP
  11. cladkins

    cladkins Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Nice Post!!!!Nice Post!!!!
     
    cladkins, Feb 10, 2010 IP
  12. rahele

    rahele Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    how can i hide a url that has parameter ? and i want to save parameter .
     
    rahele, Nov 7, 2010 IP
  13. david2211

    david2211 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Hey a simple solution would be to use http://s-urlz.com you can create a small url from your original one example

    http://forums.digitalpoint.com can be transformed into
    http://s-urlz.com/digitalpoint or
    http://s-urlz.com/10f9ec

    hidding your original url (you can even track the uses of urls on a world map with time interval)

    hope it helps
     
    david2211, Feb 14, 2012 IP
  14. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #14
    you can only do it via the post method. what you can do is when you submitted the data on a certain page, save it to a session then redirect to a page with no parameters so your user will not view the parameters..
     
    JohnnySchultz, Feb 15, 2012 IP
  15. ppce

    ppce Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    seriously ... use bestcontactform.com. No programming knowledge required. their forms track keywords, too.
     
    ppce, Apr 6, 2012 IP