PDA

View Full Version : anchors href



sir_yunus
03-08-2008, 03:48 PM
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

thetestingsite
03-08-2008, 04:13 PM
In the head section of your HTML document:



<script type="text/javascript">
function display(url) {
window.location.href=url;
}
</script>


Then in the body:


<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.

sir_yunus
03-08-2008, 04:51 PM
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