たとえば、URLからパラメーターを取得しようとしています。
www.x.com/?source=display&zone=lc&topic=クラウド
したがって、トピックが「クラウド」の場合は、3 つの個別の div を並べ替えたいと思います。
これは、これまでのヘッダーにあるものです。
<script type="text/javascript">
if (window.location.search.indexOf('topic=cloud') > -1) {
alert('track present');
$(".one").insertAfter(".two");
} else {
$(".two").insertAfter(".three");
alert('track not here');
}
</script>
html は次のようになります。
<div class="one">seo</div>
<div class="two">cloud</div>
<div class="three">social</div>
アラートが表示されますが、使用すると.insertAfter();
私は何も得ません