Streaming live at 10am (PST)

Set language of document


#1

I would like to set the lang attribute of the HTML site. The only solution I found is as follows, but it does not work in Webflow. It seems that is functionality is ignored. No console.log or try-catch showed me anything.

$('html').attr('lang','en');

Does somebody have a solution?


Language attribute on a collection page
#2

Add jQuery link at the beginning. Maybe taht will work.

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script>$('html').attr('lang','en');</script>

#3

Thanks for the hint, but I added the jQuery library already before frowning


#4

Try this:

<script>
 $(document).ready(function() {
  $('html').attr('lang','en');
 });
</script>

Haven't tested it.


#5

I am so excited, it works! I just do not know why this makes a difference here?


#6

Because this sets the function after the page loads. The problem is that the header will be sent using the old html lang tag. Refresh the page and check what headers are sent and recieved using some WebInspector in your browser wink


#7