Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

I am trying to post a url to a webpage from a separate webage when the post button is clicked and show the url.

I wanted to post a url to a separate webpage from a seperate webpage when the post button is clicked and show the url on the webpage after the post button is clicked like a social media post. What do i do i need html and JavaScript code please post the source code.

2 Answers

Steven Parker
Steven Parker
229,732 Points

You don't need a form (with submit) to display a different web page. You just need a link ("a" element) where the "href" contains the URL you want to display:

  <a href="http://the_other_URL_goes.here">Click here</a>

If t hat's not what you are looking for, perhaps you can describe it with a bit more detail or provide an example of a web page that already does it.

Im looking to be able to post a url to a separate webpage from and different webpage with html and javascript and there will be a post button and html form where a user types in a url and a clicks the post button and the url will post to the Products.html webpage From Advertise.html. Please provide source code.

Steven Parker
Steven Parker
229,732 Points

As I understand it, the purpose of this forum is for students to assist each other in leaning development skills. But it sounds like you're just soliciting for a donation in the form of a completed coding project, which is not allowed according to the Terms of Service.

If I got that wrong, and you're really trying to learn how to do it yourself, please restate the question and provide the code you have developed for it already and I'm sure you can get some help with it.