javascript – Fire HTML input-event only once when more than one character is typed

I’m creating an input field where some data should be fetched (by AJAX) and displayed every time the user enters data into that field. However, if the user types several characters, say he types “test” to get all records who contain the string “test”, it would not be necessary to do 4 queries after every character pressed, but one query after he stopped typing. I can think of several solutions with a global variable where I check if the same event has been fired again, but is there a really elegant way to do this? Maybe check if there is something in the keyboard buffer and only proceed if it is empty? Or is there an event that is only fired once the keyboard buffer is empty and all characters are in the input field?

magento2 – Flash message method doesn’t handle HTML correct, the deprecated version of the method works as expected. Why?

I tried below code

$this->messageManager->addNoticeMessage(
   __('Hi you logged in successfully to your account. Take a look in your <a href="%1">dashboard</a>', $link)
);

This doesn’t work, it results in the browser showing the HTML as text:

Hi you logged in successfully to your account. Take a look in your <a href="%1">dashboard</a>

The below one on the other hand does work, but the method is deprecated according to the class method comments MagentoFrameworkMessageManagerInterface and it reffers to addNoticeMessage that’s why I tried that method in the first place.

$this->messageManager->addNotice(
   __('Hi you logged in successfully to your account. Take a look in your <a href="%1">dashboard</a>', $link)
);

Why is that? And how can I fix it?

browsers – Do tags that are not recognized by HTML affect SEO?

Without additional context, it’s difficult to give you a concise answer to your question. It would be helpful to know more about these custom tags you’re using, how they’re implemented, and how they are ultimately rendered onto the page.

Assuming your custom tags are implemented using the Web Components API (a rather big assumption…), I don’t think there should be any impact to SEO. Web Components are implemented through a shadow DOM but ultimately get attached to a “shadow host”, which is a regular DOM element recognizable by all browsers (and crawlers, etc.).

So for example, if your <new_tag> is implemented via an h1 DOM element, it would ultimately be rendered as an h1 and can then be detected as usual for SEO (or accessibility) purposes.

I’d suggest implementing your custom element(s), then inspect the page in the browser (F12 to access Chrome DevTools) and see how it gets rendered in the HTML.

SEO/crawlability impact of HTML Streaming

Currently, as of 2021, Streaming SSR combined with partial hydration is not fully materialized. So the exact impact is unknown. But in general, streaming HTML is not a new thing. It has been there since a long time. Streaming HTML is just being implemented with modern SSR using React, Solid.js, etc.

As far as the search engines are concerned, the reduction in TTFB definitely adds to improving the page/content ranking but it won’t impact the ability to properly crawl the web page. It would behave like any other crawling. In fact, modern crawlers are smart enough to even crawl the CSR HTML.

Streaming is about getting that extra juice out of the door. Also, you are right that crawlers wait until the HTML stream ends with sensible timeouts. Long running stream would penalize the ranking.

Hostinza – Isometric Web Hosting, Domain and WHMCS Html Hosting Template

Admin submitted a new resource:

Hostinza – Isometric Web Hosting, Domain and WHMCS Html Hosting Template – Hostinza – Isometric Web Hosting, Domain and WHMCS Html Hosting Template

View attachment 18491

Hostinza Template Features:

  • 5+ Powerful Homepage Styles with unique Headers and Content
  • 20+ Unique design pages
  • Working Ajax contact form with validation
  • Valid HTML5 and CSS3
  • Fully Responsive Layout
  • CSS3 Animations
  • Mega-Menu…

Read more

.

html – creates an unnecessary space in content?

So by default WordPress include <p></p> into the content.

My view source output:

<td class="ccontent">  
<p>I would suggest choosing an easier method,<br />
This one is pretty difficult one.</p>
<p>Just a thought.</p>
</td>

On my website:

enter image description here

As you can see there’s a weird space at the bottom.

When I include <?php the_title();?> it aligns great.

But when I include <?php the_content();?> the space appears.

I did an experiment and removed the <p> from the content (using function filter).

Then it aligns great, but the content shows in a single line (which I don’t want).

So I figured that <p></p> is causing this problem.

Is there any way to fix this?

Desperatly need help.

html – Como colocar as tagas ”a” no canto do banner?

Quero colocar agendar o horário e contato no canto direito do banner e está assim :
https://prnt.sc/1gnnx6b

codigo html:

        <div class="banner"> 
            <h1 class="bannerTitulo">Transformando homens em astros</h1>
            <p class="bannerP"> A experiência completa da melhor barbearia de Curitiba.</p>
            <p class="bannerP">A melhor versão da sua barba e cabelo</p>
            <div class="botaoBanner">
                <a href="#" class="botaoAgendar">Agendar horário</a>
                <a href="#" class="botaoContato">Contato</a>
            </div>
        </div>
    </section>

códgio da pag css:
```.banner{
    background-image: url(../img/banner-barbearia.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    height: 55rem;
    
    display: flex;
    flex-flow: column;
    align-items: center;
    justify-content: center;
}

.bannerTitulo{
    color: #f2f2f2;
    font-size: 4.5rem;
    font-weight: 400;
    
}
.bannerP{
    color: #f2f2f2;
    font-size: 1.125rem;
    margin: 0;

}
.botaoBanner{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

JavaScript HTML Possible to return Datatable to original state without reloading the page?

$(document).ready(function() {

    $('#enterbutton').click(function() {
                console.log('click')
        $('.error').empty();
        let device_name = $('#device_name').val().trim();
        console.log('deviceName', device_name);
/*         if (!keyword) return $(this).prev('.error').html("Please enter a keyword first"); */
        console.log(`The keyword is ${device_name}`);
  
  var table = $('#example').DataTable({
  
    ajax: {
      url: `https://api.fda.gov/device/510k.json?search=device_name:${device_name}&limit=1000`,
      cache: true,
      dataSrc: function(response) {
        return response.results.map(function(record) {
          if (record.openfda) {
            record.regulation_number = record.openfda.regulation_number || '';
            record.device_class = record.openfda.device_class || '';
            delete record.openfda;
          }
          return record;
        });
      }
    },

columns: (
          { data: 'applicant' },
          { data: 'k_number' },
          { data: 'clearance_type' },
          { data: 'product_code' },
          { data: 'regulation_number' },
          { data: 'device_name' },
          { data: 'advisory_committee_description' },
          { data: 'date_received' },
          { data: 'decision_date' },
          { data: 'decision_code' },
          { data: 'expedited_review_flag' },
          { data: 'third_party_flag' },
          { data: 'device_class' },
          { data: 'statement_or_summary' },
          { data: 'review_advisory_committee' },
          { data: 'decision_description' },
          { data: 'country_code' },
          { data: 'state' },
          { data: 'address_1' },
          { data: 'city' },
          { data: 'contact' },
        ),
        // change default entries to any number 
    "pageLength": 100,
    dom: '1Bfrtip', 
    buttons: ({
            extend: 'collection',
            className: "btn-dark",
            text: 'Export',
            buttons: ({
                    extend: "print",
                    className: "btn-dark"
                },
                {
                    extend: "excel",
                    className: "btn-dark"
                },
                {
                    extend: "copy",
                    className: "btn-dark"
                },
                {
                    extend: "csv",
                    className: "btn-dark"
                },
                {
                    extend: "pdf",
                    className: "btn-dark"
                }
            ),
        }),

    } );
} );

      var input = document.getElementById("myInput");
    // Execute a function when the user releases a key on the keyboard
    input.addEventListener("keyup", function(event) {
    
      if (event.keyCode === 13) {
        // 13 lets enter key be used
        event.preventDefault();
        document.getElementById("myButton").click();
      }
    })


})
/* CSS styles */
h1 {
font-family: Impact, sans-serif;
color: #CE5937;
}
      
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.7.1/css/buttons.dataTables.min.css"/>
 
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.1/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.print.min.js"></script>

<h3>510K Data</h3>

<label>Enter Keyword
<input id="device_name" />
</label>
<div class='error'></div>
<button id='enterbutton'>Enter</button>

<hr>

<div class="container">
  <table id="example" class="display nowrap" width="100%">
    <thead>
      <tr>
        <th>Applicant</th>
        <th>K Number</th>
        <th>Clearance Type</th>
        <th>Product Code</th>
        <th>Regulation Number</th>
        <th>Device Name</th>
        <th>Advisory Committee</th>
        <th>Date Received</th>
        <th>Decision Date</th>
        <th>Decision Code</th>
        <th>Expidited Review Flag</th>
        <th>Third Party Flag</th>
        <th>Device Class</th>
        <th>Statement or Summary</th>
        <th>Review Advisory Committee</th>
        <th>Decision Description</th>
        <th>Country Code</th>
        <th>State</th>
        <th>Address</th>
        <th>City</th>
        <th>Contact</th>
      </tr>
    </thead>
    <tfoot>
      <tr>
      </tr>
    </tfoot>
  </table>
</div>