On resize, loading an image using the asset function in laravel
<p>I have a header with an image loaded with the <code>asset</code> laravel function :</p>

<pre><code>&lt;img class="logo" src="{{ asset('images/logo-long.gif') }}" id="logo-navbar"&gt;&lt;/img&gt;
</code></pre>

<p>And in my JS script, i want it to check whenever the size of the window is below 700px, the <code>src</code> atribute of the <code>img</code> tag change</p>

<p>So i implemented this :</p>

<pre><code>$(window).resize(function(){
    width = $(window).width();
    if(width &lt;= 700){
        $('#logo-navbar').attr('src', '??');
    }else{
        $('#logo-navbar').attr('src', '??');
    }
});
</code></pre>

<p>but i don't know how can i tell my script to generate a path like the asset function of laravel..</p>

<p>Any ideas ?</p>