Results 1 to 3 of 3

Thread: anchors href

  1. #1
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation anchors href

    hi i have a problem like this in my site i want to take which anchor clicked i want to make same work but i must take anchor's name to href i give the same name but not succesfull what can i do this

    1-) <a href=''" onClick="display()" id="conn" name="ornek1.php">exmp2</a>
    2-) <a href=''" onClick="display()" id="conn" name="ornek2.php">exm1</a>

    if click 1 window.location.href =ornek1.php
    if click 2 window.location.href=ornek2.php

    i believe you can help me

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    In the head section of your HTML document:

    Code:
    <script type="text/javascript">
     function display(url) {
       window.location.href=url;
     }
    </script>
    Then in the body:
    Code:
    <a href=''" onClick="display('ornek1.php'); return false;" name="ornek1.php">exmp2</a>
    <a href=''" onClick="display('ornek2.php'); return false;" name="ornek2.php">exm1</a>
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Feb 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yours is well but i want to change something with ajax then i want to go the other page can i explain properly in
    i want to take url but not use directly first if content changed makes its control then i want to ask do you want to apply your changes then user click yes or no then
    update applies then go to our target page which is clicked....
    http://sihirbaz.kobiline.com:2006/Wizard/Edit.aspx
    in this site when content changed hr ask do you want to change yes no cancel then it redirect you how can i do this
    Last edited by sir_yunus; 03-08-2008 at 05:17 PM.

Bookmarks

Posting Permissions

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