0
<span clk_trigger="" ae_project_id="15210" ae_page_type="list" ae_page_area="hand_filter" ae_button_type="sort by" ae_object_value="number_of_orders" class="sort-item active" data-aplus-clk="x2_2c532ee6" data-spm-anchor-id="a2g0o.productlist.0.i7.78ec3987xZpNnG" st_page_id="jipiftvnqmqcabu9171103ffc8171104036f620782">Pedidos</span>

I checked and the page is not in quirksmode, and no doctype edits so what are these attributes on the span links of the aliexpress site? Some frontend framework imported that somehow doesn't break the document format? I was interested because there was no open in new window option as they are obviously not links. (My question is about the ae- attributes not a dumb question like the data- attribute.)

user5389726598465
  • 1,418
  • 2
  • 14
  • 25

1 Answers1

1

Maybe they are internal attributes used for the site for tracking a product. It beats maintaining an API call or an array inside javascript code for each of the items...

const article = document.querySelector('span');
console.log('data attributes which can be accessed');
console.log(article.dataset);
console.log('accessing custom attributes through below method');
console.log(article.getAttribute("ae_project_id"));
console.log('this fetched attribute can be used for various actions!');
<span clk_trigger="" ae_project_id="15210" ae_page_type="list" ae_page_area="hand_filter" ae_button_type="sort by" ae_object_value="number_of_orders" class="sort-item active" data-aplus-clk="x2_2c532ee6" data-spm-anchor-id="a2g0o.productlist.0.i7.78ec3987xZpNnG" st_page_id="jipiftvnqmqcabu9171103ffc8171104036f620782">Pedidos</span>
user5389726598465
  • 1,418
  • 2
  • 14
  • 25
Naren Murali
  • 19,250
  • 3
  • 27
  • 54
  • It responds like a spa so the page doesn't reload on clicking, but I never did understand how frontends get around the !DOCTYPE format requirements. – user5389726598465 Mar 25 '20 at 06:25
  • I.E. Why are the attributes valid html? – user5389726598465 Mar 25 '20 at 06:30
  • @user5389726598465 Maybe this [SO answer](https://stackoverflow.com/questions/1735230/can-i-add-a-custom-attribute-to-an-html-tag) will help – Naren Murali Mar 25 '20 at 06:32
  • It is actually using a react frontend based on my chrome plugin, which I need a refresher on all the components as I last looked at it over a year ago. I suspect frontends actually create their own dtd under the hood but I'm guessing. – user5389726598465 Mar 25 '20 at 06:38
  • @user5389726598465 Sorry, this is the extent of my knowledge on this subject, hope you find the answer :) – Naren Murali Mar 25 '20 at 06:42