BlogEngine is not loading js files

Topics: Themes
Oct 12, 2012 at 8:12 PM

Hello,

I've created a custom theme and I'm using js files which are referenced in the master page.  However they are failing to load...

I've set up a js and scripts folder inside of my theme folder.  The reference paths are correct in the master page (no green underlines in visual studio)....am I missing how to load js files with blogengine? 

 

Thanks!

Coordinator
Oct 12, 2012 at 9:56 PM

If you using latest release (2.6) you can drop your .js files into /scripts folder and they will be added at run time.

In the latest source code (from "source code" tab on this page) it is fixed and your theme's scripts will be loaded normally.

Oct 15, 2012 at 2:51 PM

Thanks for your reply

The scripts are working on the home page of the blog, but when I navigate into an article, the scripts are 404 not found. Any way I can resolve this?

Thanks!

From: rtur [email removed]
Sent: October-12-12 4:57 PM
To: Christine Harris
Subject: Re: BlogEngine is not loading js files [blogengine:399159]

From: rtur

If you using latest release (2.6) you can drop your .js files into /scripts folder and they will be added at run time.

In the latest source code (from "source code" tab on this page) it is fixed and your theme's scripts will be loaded normally.

Coordinator
Oct 15, 2012 at 5:46 PM

You didn't mention how you adding scripts, is your theme .aspx or Razor and what version of BE you are using. Solution can be very different.

Oct 15, 2012 at 7:40 PM

I added the scripts into the Scripts folder and referenced them in the master page for the theme. I’m using BlogEngine 2.6. Theme is aspx – hope that helps! Thanks again

From: rtur [email removed]
Sent: October-15-12 12:47 PM
To: Christine Harris
Subject: Re: BlogEngine is not loading js files [blogengine:399159]

From: rtur

You didn't mention how you adding scripts, is your theme .aspx or Razor and what version of BE you are using. Solution can be very different.

Coordinator
Oct 15, 2012 at 8:24 PM

Most likely you'll be good by removing script references from theme's master page. Scripts from /Scripts folder included by back-end process, no need to reference. You'll need to clear browser cache to see if that worked, hitting Ctrl+F5 couple times should do the trick.

Oct 15, 2012 at 8:37 PM

Thanks I just tried that, but then the scripts were not found at all even on the home page, which is where they were working before. It’s just when I go into a blog post or any other view.

From: rtur [email removed]
Sent: October-15-12 3:25 PM
To: Christine Harris
Subject: Re: BlogEngine is not loading js files [blogengine:399159]

From: rtur

Most likely you'll be good by removing script references from theme's master page. Scripts from /Scripts folder included by back-end process, no need to reference. You'll need to clear browser cache to see if that worked, hitting Ctrl+F5 couple times should do the trick.

Oct 15, 2012 at 8:58 PM

Thanks for your help I solved my problem – I just need to add a “/” at the beginning of the src reference.

From: rtur [email removed]
Sent: October-15-12 3:25 PM
To: Christine Harris
Subject: Re: BlogEngine is not loading js files [blogengine:399159]

From: rtur

Most likely you'll be good by removing script references from theme's master page. Scripts from /Scripts folder included by back-end process, no need to reference. You'll need to clear browser cache to see if that worked, hitting Ctrl+F5 couple times should do the trick.