FoxInCloud
Preferred way of adding HTML attributes to an object
Gravatar is a globally recognized avatar based on your email address. Preferred way of adding HTML attributes to an object
  Paul
  All
  Jun 6, 2019 @ 10:17pm

Hi,

I could use jquery.writeAttribute in wcHTMLGen, but is there a better way?

Thanks.
Paul

Gravatar is a globally recognized avatar based on your email address. re: Preferred way of adding HTML attributes to an object
  Vincent H.
  Paul
  Jun 6, 2019 @ 11:44pm

Hi Paul,

You can use wBScTag as a screen property or use your CSS.

Vincent

Gravatar is a globally recognized avatar based on your email address. re: Preferred way of adding HTML attributes to an object
  FoxInCloud Support - Thierry N.
  Paul
  Jun 7, 2019 @ 04:16am

Hi Paul,

if you want to update a stock HTML attribute, you can use jQuery.attr('attribute', 'value')

if you want to add a custom attribute, using a data-* attribute is a standard practice, and you can also use jQuery.attr('data-some', 'value')

if you need to later manipulate this data through javaScript, you may prefer jQuery.data('some', 'value')

Gravatar is a globally recognized avatar based on your email address. re: Preferred way of adding HTML attributes to an object
  Paul
  FoxInCloud Support - Thierry N.
  Jun 9, 2019 @ 11:21pm

Thanks, that works. I was just wondering if there was an FiC way of doing it.

Gravatar is a globally recognized avatar based on your email address. re: Preferred way of adding HTML attributes to an object
  FoxInCloud Support - Thierry N.
  Paul
  Jun 10, 2019 @ 02:27am

Not really, FoxinCloud does no extension to the HTML DOM as it has been the subject for harsh discussions in the late 2000s among the Prototype framework team (FoxinCloud started using Prototype), some even consider this practice almost as evil.

HTML5 introduced the data-* attributes to overcome this dilemma, reason why I advised to use such attributes instead of plain custom attributes…
(data-* attributes are similar to the 'user' column in vcx, scx, pjx, etc.)

© 1996-2019