modern experience – Sharepoint column formatting with IF in href attribute

I got this problem:

I got a column named “TrackingNumber”. In this column I want to be able to click on the displayed Number.

The extra feature is, that in another column, there is the shipping company.

Now I would like to ensure that if, for example, “DHL” is entered as the shipping company in the “shipping” field, the DHL tracking link is used.

However, if another company is against in the “shipping” field, the other link should be used.

Right now I have the following:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "@currentField",
  "attributes": {
    "href": "=if(($note.)=='1'),'https://mydhl.express.dhl/at/de/tracking.html#/results?id=6678310192', if(($note.title)=='2', 'https://www.post.at/en/sv/item-details?snr=1034598500013780802765'))",
    "target": "_blank"
  }
}

Unfortunately, the tracking number is no longer displayed for this version.

Could someone help me here, please?

node.js – Why I get wrong link from attribute href from site steam?

I use nodejs for get all links from site steam.

In site links (for example):

  1. https://steamcommunity.com/market/listings/730/Horizon%20Case
  2. https://steamcommunity.com/market/listings/730/Chroma%203%20Case
  3. etc.

I get:

  1. https://steamcommunity.com/market/listings/730/Horizon%20Case (good)
  2. https://steamcommunity.com/market/listings/730/Chroma%20Case (wrong)

My code:

var link_part1 = 'https://steamcommunity.com/market/search?category_730_ItemSet%5B%5D=any&category_730_ProPlayer%5B%5D=any&category_730_StickerCapsule%5B%5D=any&category_730_TournamentTeam%5B%5D=any&category_730_Weapon%5B%5D=any&category_730_Type%5B%5D=tag_CSGO_Type_WeaponCase&appid=730&q=case#p1'
var link_part2 = '_price_asc'
var number_page = 1

request(link_part1+number_page+link_part2, function(err, resp, html) {
        if (!err){
          const $ = cheerio.load(html);
          for (i=0; i<10; i++) {
            let box = $("a.market_listing_row_link").eq(i).attr('href')
            console.log(box);
          }
        } else {
          console.log("Error");
        }
});

What I do wrong???

javascript – Ocultar um elemento quando href estiver vazia

Estou criando uma opção de Download para um site, nesta opção existe dois link diferentes para Download que vai mudar de acordo com os requisitos do usuário. Em alguns casos será necessário apenas exibir uma única opção. Nesse caso gostaria de ocultar a opções que estivesse sem link disponivel.

Segue o código:

        <nav>
            <ul class="menu-download">   
                <li>
                    <a style="text-decoration: none" class="btn-download" title="Baixar Grátis uTorrent">
                        <div class="btn-download-left">
                           <i class="fas fa-angle-down"></i>
                        </div>
            
                        <div class="btn-download-right">
                           <span class="btn-download-right-main">Baixar Grátis</span> 
                           <span class="btn-download-right-secondary">Download Seguro (<?php echo get_post_meta( get_the_ID(), '_my_meta_value_key_link', true ) ?> )</span>
                         </div>
                    </a>
                   
                    <ul>
                        <li><a href="<?php echo get_post_meta( get_the_ID(), '_my_meta_value_key', true ) ?>">armeabi-v8a</a></li>
                        <li><a href="<?php echo get_post_meta( get_the_ID(), '_my_meta_value_key_1', true ) ?>">armeabi-v7a</a></li>
                    </ul>
                </li>
            </ul>
        </nav>

Gostaria de ocultar o elemento <a href="">armeabi-v7a</a>- quando a href estivesse vazia, ou seja, sem nem um link. Pesquisei mais não encontrei nem uma solução que pudesse realizar isso.

javascript – Mostrar contenido únicamente al interactuar con href

Tengo un código un poco rebuscado. La idea era hacer una estructura dinámica para una lista de x pack con z ejercicios.

La estructura y el código me funcionan muy bien, el problema que tengo es que el contenido lo tengo puesto directamente en el cuerpo y con un script cargo las imágenes y vídeos. Entonces cuando entro en la página me salen las imágenes y el vídeo sin contenido (obviamente).

Lo que me gustaría es que no salieran esas imágenes vacías ni ese reproductor de vídeo vacío.

He probado a utilizar <template> pero luego al seleccionar el ejercicio no me cargaba el contenido.

Éste es el código:

<div style="text-align:center">
            <img id="id-title" alt="" style="text-align:center">
        </div>
        <div style="text-align:center">
            <img class="img_ejercicios" id="id-imagen" alt="" >
            <img class="img_ejercicios" id="id-imagen2" alt="" >
        </div>
        <br>
        <div style="text-align:center">
            <video id="id-video" controls></video>
</div>

<script>
        var direccion = "";
        $("a(class='dropdown-item ejercicio')").each(function( index, element ) {
            $(this).click(function (){
            var temporal = $( this ).attr("href").split("#")(1) ;
            title = "../packs/" + temporal + "/title.png";
            direccion = "../packs/" + temporal + "/imagen1.png";
            direccion2 = "../packs/" + temporal + "/imagen2.png";
            video = "../packs/" + temporal + "/video.mp4";
                $("#id-title").attr("src", title).css({"width": "90%"});
                $("#id-imagen").attr("src", direccion).css({"width": "35%"});
                $("#id-imagen2").attr("src", direccion2).css({"width": "35%"});
                $("#id-video").attr("src", video);
            console.log(direccion);
          })

        });
</script>

html – uBlock Origin – Create filter based on href link

I want to create a filter in uBlock for a given website where I know all the ads have an href of the following type containing “referral_story”.

<a class="_1oem" href="/marketplace/deals/item/2749298291830360/?referral_story_type=search&amp;referral_code=marketplace_search_evergreen_mixed-serp_all&amp;tracking=browse_rl%3Ab1c8a440-90c3-4646-b026-8f455cfe1066"

How could I write a filter based on this? I have tried

a[href="*referral_story*"]

but this didn’t work. I know nothing about the syntax of filters, so any help would be great.

In React, how do i render six images with each having its own external href link?

I would like to render 6 cards; each having an image that, when clicked, will direct you to an external page.

ajax – Pegar o valor da tag href com Jquery

Não estou conseguindo pegar o valor da tag href dinamicamente como fiz nos outros atributos

$('#form-celular').on('click', '#salvar', function () {
var cpf = $('input(name="cpf_pesquisado")').val();
//var select = $("#select option:selected").val();
var select = $(this).closest('tr').find('#select option:selected').val();
var celular = $(this).attr("href");
alert(celular);
$.ajax({//Função AJAX
    url: "cadastraCelular.php", //Arquivo php
    type: "post", //Método de envio
    data: "cpf=" + cpf,
    success: function (data) {
        Lobibox.notify('info', {
            msg: 'Cliente Cadastrado.'
        });
    },
    error: function (data) {
        Lobibox.notify('error', {
            title: 'Erro',
            msg: 'Deu pau!!! Corra pras Colinas'
        });
    }
});
return false;   //Evita que a página seja atualizada

});

 <div id="Celulares" class="modal modal-adminpro-general fullwidth-popup-InformationproModal fade" role="dialog">
            <form id="form-celular" action="cadastraCelular.php" method="post" >
                <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-close-area modal-close-df">
                        <a class="close" data-dismiss="modal" href="#"><i class="fa fa-close"></i></a>
                    </div>
                    <div class="modal-body">
                        <i class="fa fa-mobile modal-check-pro"></i>
                        <div class="static-table-list">
                               <input type="hidden" name="cpf_pesquisado" value="<?php echo $cpf; ?>"/>
                                <table id="table-celular" class="table">
                                <thead>
                                    <tr>
                                        <th class="pull-left">Celular</th>
                                        <th class="pull-right-pro">Opções</th>
                                        <th class="pull-right-pro">Ações</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php
                                    foreach ($dadosPessoais('pessoa')('celulares') as $celular){
                                       echo '<tr>'.
                                            '<td class="pull-left">'.
                                               '<a id"aqui" href="tel:'.$celular('ddd') . $celular('numero') .'">'. '('. $celular('ddd') .') '.  $celular('numero').'</a>'.
                                            '</td>' .
                                               '</td>'.
                                        '<td data-nome="selecionado">'.
                                            '<select name="select" id="select" class="select2-active col-lg-12">'. 
                                                '<option value="1">Celular valido</option>' .
                                                '<option value="2">Celular para Contato</option>' .
                                                '<option value="3">Celular desligado</option>' .
                                                '<option value="4">Não é do cliente</option>' .
                                                '<option value="5">Só chamou</option>' .
                                                '<option value="6">Celular Desligado</option>' .
                                            '</select>' .
                                        '</td>' .
                                        '<td> <button class="btn btn-custon-four btn-success btn-xs" id="salvar" type="button">Salvar</button></td>' .
                                    '</tr>';
                                    }
                                    ?>
                                </tbody>
                                <tfoot>
                                    <tr>
                                        <td>
                                            <button onclick="AddTableRow();" class="btn btn-custon-four btn-primary btn-xs" type="button">+Novo</button>
                                        </td>
                                    </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            </form>
        </div>

seo – How do I prevent keyword cannibalization with href lang tag?

I’m afraid that “keyword cannibalization” takes place when for example I have the following two pages on my site: /en/shoe and /en-us/shoe. Can I assume with absolute certainty that Google’s search engine in the United States only shows /en-us/shoe in the serp when it is clear to the search engine that the person doing the search with the keyword “shoe” speaks english and is in the United States. And when it is only clear to the search engine that the person speaks english that only the /en/shoe page is shown in the serp. And when both are not known the “x-default” page is the only one indexed in the serp for that person. I understand that this situation – if it can occur at all – can only occur if hreflang html tags are perfectly applied on the site.

The perfect application hreflang should look like this if I have understood everything correctly.

You can write the word ‘shoe’ in the following languages:

  • French (fr) : chaussure
  • Spanish (es) : zapato

My fictitious site has the following pages with the corresponding hreflangs:

And the next href long structure has each of the pages mentioned above.

<head>
  <title>Wha efa</title>
  <link rel="alternate" hreflang="x-default" href="http://example.com/en/shoe" />
  <link rel="alternate" hreflang="en" href="http://example.com/en/shoe" />
  <link rel="alternate" hreflang="es" href="http://example.com/es/zapato" />
  <link rel="alternate" hreflang="fr" href="http://example.com/fr/chaussure" />
  <link rel="alternate" hreflang="en-us" href="http://example.com/en-us/shoe" />
  <link rel="alternate" hreflang="en-ca" href="http://example.com/en-ca/shoe" />
  <link rel="alternate" hreflang="en-uk" href="http://example.com/en-uk/shoe" />
  <link rel="alternate" hreflang="es-us" href="http://example.com/es-us/zapato" />
  <link rel="alternate" hreflang="es-ca" href="http://example.com/es-ca/zapato" />
  <link rel="alternate" hreflang="es-uk" href="http://example.com/es-uk/zapato" />
  <link rel="alternate" hreflang="fr-us" href="http://example.com/fr-us/chaussure" />
  <link rel="alternate" hreflang="fr-ca" href="http://example.com/fr-ca/chaussure" />
  <link rel="alternate" hreflang="fr-uk" href="http://example.com/fr-uk/chaussure" />
</head>

Before I go any further, it is important to note the following.Every page about “shoe” that is written in english has almost exactly the same text. So it’s duplicate text.The same goes for Spanish and French pages on the subject of “shoe”. However, the countries have to be distinguished, because that is a requirement because the shoes are the only thing that is country specific in a manner of speaking. Using only the /en, /es and /fr variants is therefore not sufficient.

So I am looking for sources and facts that conclusively establish that keyword cannibalization will not take place. Hopefully you can provide them. 🙂

I want to Extract that URL inside href with importxml in Google spreadsheet,

Stack Exchange Network


Stack Exchange network consists of 177 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

html – Is building part of an href on a webpage from URL parameters a security risk?

I’ve written some code and have a feeling there’s a security issue with it, but I can’t figure out what it is.

Is there a security risk in including URL parameters directly into part of a link on a webpage?

Steps:

  • User visits https://www.example.com/1/guid
  • JS reads the URL, and retrieves part of it, in this case guid
  • JS builds a URL using that data https://www.example.com/2/guid
  • That new URL is added to the page (Adding the URL to the page is escaped, so injecting JS shouldn’t be a problem, in theory)

Is there any way that displaying or clicking on https://www.example.com/2/<any plain text here> could be a security flaw?