MemberStack.io

Inserting a hidden profile feed with a url into a button

Hi - I can’t seem to insert a URL that is stored in MS profile as a hidden field into a button that can be clicked. MS-data just changes the button text.

Also, this code hasn’t been working for me:

Thanks in advance to anyone that can help!

Hey Ari!

Can you post the code you were talking about?

<script>
MemberStack.onReady.then(function(member) {
    // do things with the member object
    var url = member["url"]

    document.querySelector("[url]").href = url

})

Sweet thanks.

Okay two things…

  1. Do you have that code in the footer of your page? If not, make sure it is in the Footer.
  2. Make sure the button you are trying to add the URL to has an attribute of url=true

Perfect that worked! I didn’t globally have it in the footer just in the before body closing section.

1 Like