This project is read-only.

Adding Comments fails...

Oct 20, 2009 at 12:41 AM

When I click Comments at the bottom of a post, while running Visual Web Developer, I get this error:

Microsoft JScript runtime error: Object doesn't support this property or method

on this line:

 function registerCommentBox(){
 BlogEngine.comments.flagImage = BlogEngine.$("ctl00_cphBody_CommentView1_imgFlag");

in dynamicpage.aspx.

I tried replacing line 71 in blog.js.  In the debugger, I've also checked BlogEngine.$ in the Immediate window and it returns "undefined".

Any ideas?


Oct 20, 2009 at 12:45 AM

BlogEngine.$ and all the BE JavaScript functions comes from the blog.js file.  In a normal BE page, a <script> tag is inserted into the page for JS.AXD (the JavaScript handler) that serves the blog.js file.  The <script> tag in the HTML source looks similar to:

<script type="text/javascript" defer="defer" src="/js.axd?path=%2fblog.js&amp;v="></script>

I would check to make sure you have something like that in your HTML source.  I'm not sure what dynamicpage.aspx is.

Oct 20, 2009 at 4:34 PM

Thanks that put me on the right track.  On my local machine, I had changed Blog.js to use $BE instead of $ so that it wouldn't conflict with JQuery.  Locally, I had changed it back, but the copy on host provider still had the old copy, so it couldn't resolve the objects in order to handle the comments.  I updated my server copy and all is well.