Javascript to reference meta description tag

Discussion in 'JavaScript' started by dimplesshop, Jun 25, 2010.

  1. #1
    Hi,

    I have am using a javascript for my websites gift registry which was provided to me by by the gift registry company. The script is setup to pull the pages title tag and url and put in a pop up window when a customer adds the product to their registry.

    I have tried adding to elements? (not sure if that is what theyre called) to add the price and either the page's description or meta description to the pop up window's fields that already exist. I feel that I must be close as I am not longer getting an on page error message, but the fields are populating with "[object HTMLMetaElement]"

    the javascript is as follows:

    <script language=javascript>
    function yahooMGLpopup(refsource, storename, cartname) {
     var u
     u = "http://www.mygiftlist.com/register_gift.asp?refSource=" + escape(refsource) + "&giftURL=" + escape(location.href) + "&giftName=" + escape(document.title) + "&giftRetailer=" + escape(storename) + "&giftCart=" + escape(cartname) + "&giftDescription=" + escape(document.getmetadescription) +"&giftPrice=" + escape(document.Price);
     var mgl = window.open(u,"MGL","width=700,height=500,top=60,left=100,resizable,scrollbars");
    }
    </script>
    Code (markup):
    I added the following:
    + escape(document.getmetadescription) +"&giftPrice=" + escape(document.Price);
    Code (markup):
    Can someone please tell me what im doing wrong?

    You can view any of my product pages at: www.DimplesShop.com

    Please help,
    Jeremy
    www.DimplesShop.com
    jeremy@DimplesShop.com
     
    dimplesshop, Jun 25, 2010 IP