سؤال

I'm using the LinkedIn Share Plugin Generator, which suggests using the following code:

<script src="//platform.linkedin.com/in.js" type="text/javascript">
  lang: en_US
</script>
<script type="IN/Share" data-counter="top"></script>

What could the lang: en_US be doing in that first <script> element? Surely it is invalid for there to be both a src attribute and content?

هل كانت مفيدة؟

المحلول

It isn't invalid, it just never gets passed to the JavaScript parser.

It is there to be accessed via DOM by the script.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top