TonyDanza Posted November 16, 2010 Share Posted November 16, 2010 Hi all, I need to write a link using only clientside technologies. I've tried <a href="window.location" > which doesnt work, I guess its because the JS isnt wrapped in script tags, Does anybody have any other possible solutions? Link to comment https://forums.phpfreaks.com/topic/218846-windowlocation-as-a-link/ Share on other sites More sharing options...
trq Posted November 16, 2010 Share Posted November 16, 2010 Hi all, I need to write a link using only clientside technologies. That is indeed the only way to create a link. Where exactly do you want the link to go? Your question isn't at all clear. Link to comment https://forums.phpfreaks.com/topic/218846-windowlocation-as-a-link/#findComment-1134963 Share on other sites More sharing options...
TonyDanza Posted November 16, 2010 Author Share Posted November 16, 2010 Sorry i was on the phone whilst typing that and only just read it back, I have a link which when clicked should go to the current window location. I cant use php to fulfill this otherwise I'd use <a href="$_SERVER['PHP_SELF'];"> so i have to think of an alternative method to populate the location, does this make sense? Link to comment https://forums.phpfreaks.com/topic/218846-windowlocation-as-a-link/#findComment-1134967 Share on other sites More sharing options...
trq Posted November 16, 2010 Share Posted November 16, 2010 <a href="">click<a/> Link to comment https://forums.phpfreaks.com/topic/218846-windowlocation-as-a-link/#findComment-1134968 Share on other sites More sharing options...
TonyDanza Posted November 16, 2010 Author Share Posted November 16, 2010 nevermind I figured it out, i must have worded my question wrongly.. the result i was trying to achieve was this... <SCRIPT LANGUAGE="JavaScript"> document.write("<a href="+document.URL+">link <\/a>); </SCRIPT> Link to comment https://forums.phpfreaks.com/topic/218846-windowlocation-as-a-link/#findComment-1134974 Share on other sites More sharing options...
trq Posted November 16, 2010 Share Posted November 16, 2010 My code will do the same thing. Link to comment https://forums.phpfreaks.com/topic/218846-windowlocation-as-a-link/#findComment-1134977 Share on other sites More sharing options...
TonyDanza Posted November 16, 2010 Author Share Posted November 16, 2010 Yeah I worded my question wrongly, It would'nt have worked for what I needed. Thanks Thorpe Link to comment https://forums.phpfreaks.com/topic/218846-windowlocation-as-a-link/#findComment-1135028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.