Using jQuery to include an HTML element if the URL has a keyword and doesn't contain another keyword (at the same time)?
<p>I want to add an image a page that has this at the end of the URL: <code>/esl-jobs-in-china/</code> but I don't want to include it in pages that have something like this at the end of the URL: <code>/esl-jobs-in-china/view/</code>.</p>

<p>So I wanted an if statement like this: Include the picture if the URL has <code>/esl-jobs-in-china/</code> and doesn't have <code>/view/</code>.</p>

<p>I tried this:</p>

<pre><code>// Add image in Job Board
if(url.indexOf('/esl-jobs-in-china/') &gt;= 0 &amp;&amp; url.indexOf('/view/') &gt;= -1) {
        $('.entry-content').prepend('&lt;img width="425" height="282" src="http://goldstarteachers.com/wp-content/uploads/2011/11/3.jpg" class="attachment-full wp-post-image" alt="Shane English Schools China" title="Shane English Schools China"&gt;');
}
</code></pre>

<p>But I'm still getting the picture displayed in the pages containing <code>/esl-jobs-in-china/view/</code> in the URL</p>

<p>Any suggestions to solve this?</p>
