IE8 Html Parser Error => AddThis Button / CatalogSettings.PageShareCode

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
  <a class="addthis_button_preferred_1"></a>
  <a class="addthis_button_preferred_2"></a>
  <a class="addthis_button_preferred_3"></a>
  <a class="addthis_button_preferred_4"></a>
  <a class="addthis_button_compact"></a>
  <a class="addthis_counter addthis_bubble_style"></a>
</div>
<script  type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=nopsolutions"></script>


The above code comes from CatalogSettings.PageShareCode which is used in the _ShareButton in Product Details page.  The script tag above is causing an HTML Parser Error in IE8.  More specifically: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)

This error is causing the Product Specifications not to display and some other issues as well. It's causing the page-body div element to not have the proper height, which is why, I *think*, product specifications is not displaying in IE8.

Does anyone know what to do to fix the issue???
9 years ago
<script  type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=nopsolutions">
</script>

The script was the problematic html/code, to fix this issue in IE7/8 I had to do the following:

I downloaded the addthis_widget.js javascript file and saved it in the following location:  ../Nop.Web/Scripts/

I edited the following files:  

../Nop.Web/Views/Product/ProductTemplate.Simple.cshtml
../Nop.Web/Views/Product/ProductTemplate.Grouped.cshtml
(any other custom product templates you may have created)

In the above product template files you need to add the following code to the top of each:

@{
    //...
    Html.AppendScriptParts("~/Scripts/addthis_widget.js");
    //...
}


once edited, save the changes, and rebuild the project and load up the webpage.  once loaded, login as admin and navigate to the admin section.  once there you need to modify the following setting (Configuration -> Settings -> All Settings):

catalogsettings.pagesharecode

that setting will contain the following data:

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    <a class="addthis_button_compact"></a>
    <a class="addthis_counter addthis_bubble_style"></a>
</div>
<script  type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=nopsolutions"></script>
<!-- AddThis Button END -->


and needs to be changed to the following (remove the script element):

<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
    <a class="addthis_button_preferred_1"></a>
    <a class="addthis_button_preferred_2"></a>
    <a class="addthis_button_preferred_3"></a>
    <a class="addthis_button_preferred_4"></a>
    <a class="addthis_button_compact"></a>
    <a class="addthis_counter addthis_bubble_style"></a>
</div>
<!-- AddThis Button END -->


Once changed, click update, then go back to your browser, navigate to a products details and the error will no longer exist.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.