Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi, I’m afraid I do not understand the question. Maybe if you give an example on your site so I can see it happen live?

    Thread Starter mhariszafar

    (@mhariszafar)

    If you search any keyword like “sms” and this keyword can show some results with included homepage,

    Home page url is showing only “www.example.com” but we were required the “www.example.com/?hilite=%27SMS%27”

    Thread Starter mhariszafar

    (@mhariszafar)

    SOLVED FROM JAVASCRIPT

    var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = window.location.search.substring(1),
    sURLVariables = sPageURL.split(‘&’),
    sParameterName,
    i;

    for (i = 0; i < sURLVariables.length; i++) {
    sParameterName = sURLVariables[i].split(‘=’);

    if (sParameterName[0] === sParam) {
    return typeof sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
    }
    }
    return false;
    };

    var urlParams = new URLSearchParams(window.location.search);

    if(urlParams.has(‘s’) == true) {
    var paramValue = getUrlParameter(‘s’);
    jQuery(“a[rel=’bookmark’]”).each(function(){
    var value = jQuery(this).attr(‘href’);
    if(value == ‘https://example.com/&#8217;) {
    jQuery(this).attr(‘href’,’https://example.com/?hilite=%27’+paramValue+’%27&#8242;)
    }
    })
    }

    • This reply was modified 3 years, 9 months ago by mhariszafar.

    Strange, I can not reproduce the issue. When I do this search https://demo.status301.net/?s=scrolling%20test the first result is the home page and it has ?hilite=%27scrolling%27%2C%27test%27 after the link URL…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Does not append highlighted param’s with home page link’ is closed to new replies.