How can I fix this Script error?

Error:
Open quote is expected for attribute “expr:id” associated with an element type “div”.

Script:

<div expr:id=’&quot;aim1&quot; + data:post.id’/>
<div style=’clear:both; margin:10px 0′>
Your Adsense Code Here
</div>
<div expr:id=’&quot;aim2&quot; + data:post.id’>
<data:post.body/>
</div>
<script type=’text/javascript’>
  var obj0=document.getElementById(&quot;aim1<data:post.id/>&quot;);
  var obj1=document.getElementById(&quot;aim2<data:post.id/>&quot;);
  var s=obj1.innerHTML;var t=s.substr(0,s.length/2);
  var r=t.lastIndexOf(&quot;&quot;);
  if(r&gt;0){obj0.innerHTML=s.substr(0,r);
  obj1.innerHTML=s.substr(r+1)}
</script>

let me where the error exists and how can I fix that?

I am not sure. But try like this??

<div expr:id=’&quot;aim1&quot; + data:post.id’>
</div>
<div style=’clear:both; margin:10px 0′>
Your Adsense Code Here
</div>
<div expr:id=’&quot;aim2&quot; + data:post.id’>
<data:post.body/>
</div>
<script type=’text/javascript’>
  var obj0=document.getElementById(&quot;aim1<data:post.id/>&quot;);
  var obj1=document.getElementById(&quot;aim2<data:post.id/>&quot;);
  var s=obj1.innerHTML;var t=s.substr(0,s.length/2);
  var r=t.lastIndexOf(&quot;&quot;);
  if(r&gt;0){obj0.innerHTML=s.substr(0,r);
  obj1.innerHTML=s.substr(r+1)}
</script>

still the same error even after adding your code: (Open quote is expected for attribute “expr:id” associated with an element type “div”)

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div itemprop='articleBody' style='font-size:14px;line-height:19px;'>
 <div expr:id=’&quot;aim1&quot; + data:post.id’>
</div>
<div style=’clear:both; margin:10px 0′>
Your Adsense Code Here
</div>
<div expr:id=’&quot;aim2&quot; + data:post.id’>
<data:post.body/>
</div>
<script type=’text/javascript’>
  var obj0=document.getElementById(&quot;aim1<data:post.id/>&quot;);
  var obj1=document.getElementById(&quot;aim2<data:post.id/>&quot;);
  var s=obj1.innerHTML;var t=s.substr(0,s.length/2);
  var r=t.lastIndexOf(&quot;&quot;);
  if(r&gt;0){obj0.innerHTML=s.substr(0,r);
  obj1.innerHTML=s.substr(r+1)}
</script>
</div>
<div class='clear'/>
  </b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div style='margin-top:20px'>
</div>

Off Topic
@kumarsluck: to format code blocks correctly, you need to place three backticks ``` on a line before your code, and three on a line after your code. Single backticks are for marking inline code, and don’t highlight code blocks correctly.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.