'BlogEngine' is undefined

Topics: ASP.NET 2.0
Jul 10, 2009 at 4:11 PM

I keep getting the error 'BlogEngine' is undefined when I load my blog to the production server.  This is stopping me from searching, and using the blog archive.  My blog is found at http://www.backcountrysecrets.com/blog.

Here is what I have tried so far:

Unchecked Compress WebResource.axd

I am on IIS7 and changed IIS to default app pool.

Is it possible that this is a permissions issue?

Jul 10, 2009 at 4:53 PM

I just found the solution to my problem in this thread: http://blogengine.codeplex.com/Thread/View.aspx?ThreadId=54245

"Hi guys,

I had the same issue on Mosso. It was working on my dev machine, but not on live site. I've tried a few things and probably all the above, but the solution that worked for me was very simple:
The first line of the blog.js script:
// global object

Just delete it and thats it!

I hope it helps.

Dmitri @ hobbything.com"

I have NO CLUE why that worked.

Aug 4, 2009 at 10:52 AM
kadesmith wrote:

I keep getting the error 'BlogEngine' is undefined when I load my blog to the production server.

 In my case it was a combination of the Visitor info widget and slow load times. This meant that the BlogEngine object sometimes wasn't initialized when the widget script ran, which resulted in a script error.

So, I simply surrounded the APML lookup function with a try-catch to circumvent the problem.

Now I'm finally not running into any more script errors, yay! :)

PS. In my case, everything else worked fine, such as searching, commenting etc. DS.

function checkApml() {
    try {
        var apml_url = '<asp:literal runat="server" id="ltWebsite" />';
        BlogEngine.createCallback(BlogEngine.webRoot + 'widgets/VisitorInfo/apmlchecker.ashx?url=' + apml_url,
	function(response) {
	    if (response.length > 10) {
	        var text = 'I can see you have an APML file at <a href=\"' + apml_url + '">' + apml_url + '</a>. ';
	        text += 'Do you wish to filter the content of this blog based on your APML file? ';
	        text += '<a href="javascript:void(location.href=\'' + BlogEngine.webRoot + '?apml=' + encodeURIComponent(response) + '\')">Apply filter</a>';
	        BlogEngine.$('visitor_widget_apml').innerHTML = text;
    catch(err) { }