3

This is the first time I have seen this code:

 <div id="extruderLeft" class="{title:'Our network ', url:'parts/extruderLeft.html'}"></div>
 <div id="extruderLeft1" class="a {title:'Leyenda', url:'parts/extruderLeft1.html'}"></div>

Is a jquery Plugin, I´m sure that is a HTML constructor, the plugin is called here:

<script>
 $("#extruderLeft1").buildMbExtruder({
                position:"left",
                width:300,
                extruderOpacity:.8,
                onExtOpen:function(){},
                onExtContentLoad:function(){},
                onExtClose:function(){}
            });
</script>

Is it good practice?

Thank you very much!

Funny Frontend
  • 3,807
  • 11
  • 37
  • 56
  • I doubt that HTML5 allows anything but CSS class names in the `class` attribute. – Tomalak Aug 01 '14 at 07:55
  • 3
    @Tomalak: CSS has nothing to do with HTML. Class names are a property of HTML, not CSS. See also http://stackoverflow.com/questions/18701670/can-i-use-non-existing-css-classes/18701712#18701712 That being said, it's clear that the class attribute is being misused here. – BoltClock Aug 01 '14 at 07:59
  • @BoltClock I hesitated to say something like "space separated name tokens", so I used a more colloquial term. I would have expected that something like this would not validate, but I've just checked and it does. So it's purely a semantical error, not a technical one. – Tomalak Aug 01 '14 at 08:48

1 Answers1

1

As you are specifying an example of jquery.mb.extruder plugin, You should go through its official docs, it is HTML constructor.

Satpal
  • 132,252
  • 13
  • 159
  • 168
  • Yes, I´m sure that is a HTML constructor, but this is the first time I have seen a constructor inner a `class` atributte. Is it good practice? – Funny Frontend Aug 01 '14 at 08:12
  • @RP_morales, According to me its complete misuse of class attribute. developers should have used custom `data-*` attibutes. – Satpal Aug 01 '14 at 08:41