Added JS File Dosen't Work

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 年 前
Hey,

I'm working on custom theme and I added some js file to -> themes/newtheme/views/shared/head.cshtml

Here is my problem:

Added script file dosen't work on my project but when I copy script block from this file and paste needed page, it's working.

So why my script files dosent work with first method?
6 年 前
alperbaskir wrote:
Hey,

I'm working on custom theme and I added some js file to -> themes/newtheme/views/shared/head.cshtml

Here is my problem:

Added script file dosen't work on my project but when I copy script block from this file and paste needed page, it's working.

So why my script files dosent work with first method?


1. Could you ensure your Js file loaded in the client browsers?

2. if yes, then may be your script run before html load. You should debug js code from browsers.
6 年 前
As Sohel indicates, it's probably not being called before the HTML starts rendering..
I had similar issues with some scripts and the easiest solution was to just add those new scripts into the /Scripts/public.common.js file.
6 年 前
Thank you guys. Problem solved.

I guess script which I added not need to load on head tags. then I go required page and add script file like I copied custom theme. and its  working.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.