treehouse : what would you like to learn today?
Web Design Web Development iOS Development

help with how to save a url

  • I have built a site where my users can open a popup look for gifts in the popup window then save the urls to a list that they can share with friends. It works but the only way I can find to make it work is by the user copying and pasting the url into the form to create the list. Is there a way I can make the process more simple.
  • try this:

    $(function() {

    $('button').click(function(){
    var theUrl = document.URL;
    $('#myinput').val(theUrl);
    //uncomment the line below if you do want to submit the form right away
    //return false;
    });

    });