Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htmlCompatibility="html5" doesn't remove type when using the LazyLoadRenderer #203

Open
andersbrohall opened this issue Jan 28, 2022 · 0 comments

Comments

@andersbrohall
Copy link

When using 1.9.10, with htmlCompatibility set to "html5" the output in the view still contains type="text/javascript" in the script tags rendered as a compliment to /WebResource.axd.

Example:

StandardRenderer:
<script src="/Scripts/blocking.js?cdv=123" ></script>

LazyLoadRenderer:
<script src="/WebResource.axd?d=zwknGD9um8nJ5iro3fpcG6bP2uF2y04XGbo_kIftxgePzGwzeshejCqMB8cS1HzSGnFy8XC_FwwsdTjCXr93L7CZirYmQHdnVXsyZQaaAgvbNxmmOF0IktRA-cyRKfds_yH9ij26fEtQug7rP96QCdpLt8-YwLyrldbrOM2vkTY1&t=637570492660000000" ></script><script type="text/javascript">CDLazyLoader.AddJs('/Scripts/lazy.js?cdv=123');</script>

The htmlCompatibility-switch is in set the clientDependency element in web.config (or /config/ClientDependency.config to be precise since we're using Umbraco 8.13.0)
<clientDependency htmlCompatibility="html5" version="123" fileDependencyExtensions=".js,.css" loggerType="Umbraco.Web.CdfLogger, Umbraco.Web">

Works:
Html.RequiresJs(new JavascriptFile("~/Scripts/blocking.js") {ForceProvider = "StandardRenderer"});
@Html.Raw(Html.RenderJsHere("StandardRenderer"))

Not working:
Html.RequiresJs(new JavascriptFile("~/Scripts/lazy.js") {ForceProvider = "LazyLoadRenderer"});
@Html.Raw(Html.RenderJsHere("LazyLoadRenderer"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant