iStriide Posted July 30, 2010 Share Posted July 30, 2010 I just started javascript, and i was wondering if their was a way that you use the prompt(""); code or document.write or something that will pop with a box like alert but that you can type in a url and click ok and it will take you to that page. Link to comment https://forums.phpfreaks.com/topic/209315-linking-with-javascript-help/ Share on other sites More sharing options...
Adam Posted July 30, 2010 Share Posted July 30, 2010 Yeah, pretty easily. The basic code would be something like: var url = prompt('Prompt message here..'); if (url) { window.location = url; } You'll most likely want to add in some URL validation though. Link to comment https://forums.phpfreaks.com/topic/209315-linking-with-javascript-help/#findComment-1092999 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.