I really need to display the current URL on the page with JavaScript. How can I do it? What is the procedure to get the URL of the page with the help of JavaScript? Thanks in advance.
Still waiting...... I am really surprised of not seeing any reply on this forum. I really need help on this time. Hope to find the answer sooner. Thanks in advance.
I don't want alert part. I need to output ( display ) the page URL dynamically to the user on the page. Not on the way of alert message.
http://uk3.php.net/reserved.variables echo 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; PHP: That should work. EDIT: Sorry, didn't realise this was the JavaScript forum. I don't know any javascript at all, but isn't JS a clientside language thus making it impossible?
I know PHP on great extent. But improving my JavaScript. Iam looking for JavaScript code to give the result. Also looking for some other techniques with JavaScript. I believes that JavaScript having a great role for my dynamic pages. For my page's completion, I need answers like this question. If some one there who are expert on JavaScript, solve my question. I will definitely contact him/her with some other questions.
I'm totally new to JavaScript, but this seems to work.... put this code in your HTML right where the URL is supposed to appear: <script type="text/javascript"> <!-- document.write(document.location.href); //--> </script> -Troy
That works for me now... Thanks... But now, it is time to ask another question: How I can display the page's title Dynamically? Hope that the answer will get quickly...