Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: anchors

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post

    anchors

    is there a way to control the link of every anchor on the page. I want something like a:link { href="http://slashdot.org" } I know this code is wrong. But is there a way to do this? All help is appreciated.
    I would rather be a lion for a day than a lamb that lives forever.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Auckland New Zealand
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not sure what you want. Do you want every link to go to the same URL?

    Please expand.

    Tonz
    Beware, the Cybertooth tiger cometh

  • #3
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Originally posted by Tonz
    Do you want every link to go to the same URL?
    If that is the case, you could just have all the function point to a JS function. And then that function would open the url specified.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    Originally posted by oracleguy


    If that is the case, you could just have all the function point to a JS function. And then that function would open the url specified.
    I want all links to go to same url, please explain how... I have to use css because I have a form where I am making the person type "< a >" in the textarea to make a link
    I would rather be a lion for a day than a lamb that lives forever.

  • #5
    New Coder
    Join Date
    Jun 2002
    Location
    London & Oxford
    Posts
    97
    Thanks
    0
    Thanked 0 Times in 0 Posts
    CSS is only used for layout. You cannot change the link with CSS, only the way the text appears on the page.

    You could make all the links go to the same address using plain old HTML or javascript.

    Please explain in a bit more detail what you are trying to do.
    As easy as 3.1415926535897932384626433832795028841

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    interesting, so I can't say

    <style>
    a.href { http://www.webmonkey.com }
    </style>

    I know this does nada, but this is what I want, where eveytime an <a> shows up on a page I get a link to webmonkey. That's all I want to do, so everytime <a>someword</a> is clicked it goes to webmonkey.
    I would rather be a lion for a day than a lamb that lives forever.

  • #7
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    All I can really tell you is just to change all the links on your page to this:

    <a href="www.webmonkey.com">someword</a>

    Using JavaScript for something such as this would be pointless and possibly not even possible. If you can expand as to some reason why you can't just use normal HTML and change all the link properties then please do.

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Posts
    676
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Originally posted by bacterozoid
    All I can really tell you is just to change all the links on your page to this:

    <a href="www.webmonkey.com">someword</a>
    /me just a thinks® thattt s/b...
    <a href="http://www.webmonkey.com">someword</a>
    The New JustaBuster Version 2.0 OR JustaBusta Lite V2.0
    ...just a special® thanx kinda hugs to jkd n' nex ...:O)))

    CommemorateWTC.com --Please lend your support

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    OK I am grabbing information from a database and instead of having the user, the one inputting the form information, write out the anchor, ie. <a href="http://www.webmonkey.com">word</a>, I would like him or her to just write and have the code on the displaying page link the anchor... I hope that's more clear
    I would rather be a lion for a day than a lamb that lives forever.

  • #10
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    Well, it almost seems like you are allowing a user to create a page, and you want a link automatically put on the page that links to webmonkey.

  • #11
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    Originally posted by bacterozoid
    Well, it almost seems like you are allowing a user to create a page, and you want a link automatically put on the page that links to webmonkey.
    yip that's what I want to do, can you help me do that?
    I would rather be a lion for a day than a lamb that lives forever.

  • #12
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    Yes, I think I could help you...depending on what exactly you want to do. Are you wanting this to be like a web hosting service where their page is permanent? Or do you just want the user to type HTML in a box and it pops up in a window for them to see it, and only be temporary.

  • #13
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    let's go for the temporary one
    I would rather be a lion for a day than a lamb that lives forever.

  • #14
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    alright, i have a code on one of my pages that does that, but i will need to see if i can modify it to include the link...gimme a bit here to see..if i cant ill just give you the code and you can ask someone else, lol.

  • #15
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    Go here to see it in action...minus the link branding thing.

    http://www21.brinkster.com/jonshtmlhelp/previewhtml.htm

    PUT THIS IN THE HEAD TAG OF YOUR DOCUMENT.


    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function displayHTML(form) {
    var inf = form.htmlArea.value;
    win = window.open(", ", 'popup', 'toolbar = no, status = no');
    win.document.write("" + inf + "");

    //modify text inside of quotes below to change link properties - the \ marks ignore the quotes from interfering with the code

    win.document.write("<p align=\'center\'><font size=\'1\' face=\'arial\'><a href=\"http://www.webmonkey.com\">Webmonkey</a></p>");
    }
    // End -->
    </script>


    THIS GOES WHERE YOU WANT THE TEXT BOX FOR PREVIEWING

    <form>
    <textarea name="htmlArea" cols=50 rows=10>
    </textarea>
    <br>
    <input type="button" value=" Preview HTML " onclick="displayHTML(this.form)">
    </form>


    That should do it...
    Last edited by bacterozoid; 07-23-2002 at 04:11 PM.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •