How to add popups for comapare products in magento2

app shop shop Magento_Catalog templates product compare link.phtml


app shop shop Magento_Catalog templates product compare list.phtml


getItems () -> getSize ()?>
<a href = "#" class = "print hidden-print action" title = "">
getItems () as $ item):?> helper ( Magento Catalog Helper Output :: class); ?> getItems () as $ item):?> <td data-th = "escapeHtml (__ (Product #)) ?? "class =" product information of the cell "> <a class = "product-item-photo" href = "getProductUrl ($ item)?> "title ="stripTags ($ item-> getName (), null, true)?> "> getImage ($ item, & # 39; product_comparison_list & # 39;) -> toHtml ()?> <a href = "getProductUrl ($ item)?> "title ="stripTags ($ item-> getName (), null, true)?> "> productAttribute ($ item, $ item-> getName (), & nbsp; name) getReviewsSummaryHtml ($ item, & quot; short & quot;)?> getProductPrice ($ item, -compare-list-top)?>
isSaleable ()):?> <form data-role = "tocart-form" action = "helper ( Magento Catalog Helper Product Compare :: class) -> getAddToCartUrl ($ item)?> "method =" post "> getBlockHtml (& # 39; formkey?)?> getIsSalable ()):?>
helper ( Magento Wishlist Helper Data :: class) -> isAllow ()):?>
getAttributes () as $ attribute):?> hasAttributeValueForProducts ($ attribute)):?> getItems () as $ item):?>
helper ( Magento Catalog Helper Product Compare :: class);?> <a href = "#" data-post = & # 39;getPostDataRemove ($ item)?> & # 39; class = "action delete" title = "">
EscapeHtml ($ attribute-> getStoreLabel ()? $ Attribute-> getStoreLabel (): __ ($ attribute-> getFrontendLabel ())?>
getAttributeCode ()) { case "price":?> getProductPrice ( $ item, & # 39; -compare-list - & # 39 ;. $ attribute-> getCode () ) ?> getImage ($ item, & # 39; product_small_image & # 39;) -> toHtml (); ?> productAttribute ($ item, $ block-> getProductAttributeValue ($ item, $ attribute), $ attribute-> getAttributeCode ())?>
isRedirectToCartEnabled ()):?>

In the js file I added this script, when you click on the link of the article, the comparison popup is not an openaning, as indicated by nodename not found .. tell me how to add a popup to compare the products