I am working with dynamics and I am trying to pull in a variable from the form and use it to create a dynamic URL Here is my code:
<html>
<head>
<meta charset="utf-8">
<script src="new_/jquery.js"></script>
<script>
$( document ).ready(function() {
var $productid = attr("src",parent.window.Xrm.Page.getAttribute('new_productid').getValue());
});
</script>
</head>
<body style="word-wrap: break-word;">
<div style="align: center;">
<script type="text/javascript">
document.write('<a href="http://www.mywebsite.com/products/'+productid+'">Link to some site</a>');
</script>
</div>
</body>
</html>
Can anyone see what I am doing wrong?
$productidvsproductid. Remove the$. Also, in the future, you should explain what is happening vs what you want/expect to happen. All you're saying now is that something's wrong. It's usually hard to find what's wrong when you don't know what's happening.attrfunction you are calling in the.readycallback, JS has no nativeattrglobal function