You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@morsssss This looks like a question about how you could execute something with AMP Script. Could you take a look and see if we have adequate answers in our documentation?
Hey @danyal1248 ! I can't entirely tell what you're trying to do from the partial code you provide. It does look like you want to make it so that when a user clicks one DOM element, you set a state variable to false.
If that's not enough, please feel free to ask for more detailed help on Stack Overflow - or to sign up for the AMP Slack channel, where AMP developers discuss questions like this.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
Call add to cart to perform action on this id
addI want to append result in this amp script container or add any div in this container but script will remain same addToCart
<script id="addToCart" type="text/plain" target="amp-script"> let bottomSheetView = document.getElementById("bottomSheetView"); if(bottomSheetView) { bottomSheetView.addEventListener("click",createBottomSheet); } async function createBottomSheet() {enter code here let productId = JSON.parse(await AMP.getState('productId.id')); AMP.setState({bottomSheet:false}); console.log(productId); } </script> <script type="application/json"> { "id" : "" } </script>Note : Conclusion is that I want to execute one function and parse id in this and show result on another div or something in replace
The text was updated successfully, but these errors were encountered: