Author Topic: For Clean Code - Shall I Modify.  (Read 293 times)

onlineservices

  • Veteran Member
  • *****
  • Posts: 242
  • Karma: +0/-0
For Clean Code - Shall I Modify.
« on: December 31, 2017, 08:40:36 AM »
Towards clean html standards, shall i modify these things ?

Quote
<a class="navbar-brand" id="pagetop" name="pagetop" href="{tplvars.relative_url}index.php" title="{tplvars.sitename}">{tplvars.sitename}</a>

Shall i remove name="pagetop" which is obsolete
------

Quote
<script src="js/csrf-magic.js" type="text/javascript">

Shall i remove type="text/javascript" which is unnecessary?
------
Quote
<img src="http://example.com/etano/media/pics/t1/6/242_11495536689.jpg" onerror="this.src='media/pics/no_photo.gif';" />
<br />
<img src="http://example.com/etano/media/pics/t1/5/195_11510679366.jpg" onerror="this.src='media/pics/no_photo.gif';" />

How to add default or specific alt tag for these type of images?
-----
Quote
      <div class="navbar-header">↩
         <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#mobile-menu">↩
            <span class="sr-only"><?=__('Toggle navigation')?></span>↩
            <span class="icon-bar"></span>↩
            <span class="icon-bar"></span>↩
            <span class="icon-bar"></span>↩
         </button>↩
<? is a xml processor. XML processing instructions are not supported in HTML . How to manage this?
-----
Suggestion appreciated !!!

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3107
  • Karma: +210/-7
    • Maverick Webworks
Re: For Clean Code - Shall I Modify.
« Reply #1 on: December 31, 2017, 10:29:57 AM »
Quote
Shall i remove name="pagetop" which is obsolete
This primarily used on the profile comments page so users can quickly scroll back to the top of the page, but if you're not using it then go ahead and remove it, it's up to you.

Quote
Shall i remove type="text/javascript" which is unnecessary?
Removing it could cause issues for those using older browsers, and although it's not necessary it still could cause validation issues. It's not hurting anything and better safe than sorry, but again it's up to you.

Quote
How to add default or specific alt tag for these type of images?
Well if you feel it's important you can add it like this:
Code: [Select]
<a class="link_bare" href="{tplvars.baseurl}/{profile._user}"><img class="user_photo thumb1" src="{tplvars.photourl}/t1/{profile._photo}" alt="{profile._user}" onerror="this.src='media/pics/no_photo.gif';" /></a>It gets changed in the skins_site\def\static\result_user.html file.

Quote
<? is a xml processor. XML processing instructions are not supported in HTML . How to manage this?
I can't help you as it's a custom function that I'm not familiar with.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

onlineservices

  • Veteran Member
  • *****
  • Posts: 242
  • Karma: +0/-0
Re: For Clean Code - Shall I Modify.
« Reply #2 on: January 02, 2018, 11:57:44 AM »
Thanks to Mr. Maverick