skip to Main Content

How can I remove ?v=2222dddhh4 from img srouce in shopify ?

Main source:

I want:

<img src="https://cdn.shopify.com/s/files/1/1608/4177/files/Size_Guide.png>

2

Answers


  1. using javacsript and jquery maybe help you:

    $('img').each(function(){
     var _src = $(this).attr('src');//get attribute src
     _src = _src.replace(/?v=.*?$/g,'');
     $(this).attr('src',_src);//replace your same img
     $('span').append(_src);//for test
    });
    

    jsfiddle

    Login or Signup to reply.
  2. or you can simply use:
    | split:'?' | first
    it will split your link from ‘?’ and will show just the first part which is the link before the ‘?’.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search