Unable to load JS file

120 views
Skip to first unread message

Rohit Waghchaure

unread,
Jul 15, 2014, 3:20:04 AM7/15/14
to erpnext-dev...@googlegroups.com
Hi All,

     I have created a new js file on path assets >>js >>custom_file.js , i have to include this file in page. For that, in hooks.py(Erpnext) i have assigned my custom js file's path to variable web_include_js. To load the js file on the head my code is,
          web_include_js = ["assets/js/erpnext-web.min.js","assets/js/custom_file.js"]

     I have written a function XYZ() in this file, When I called to XYZ, it shows an error "Object has no method XYZ". It means the js file is not be loaded on the page.

     Is this right way to load js file? Please provide me the solution

Thanks, Rohit

Rushabh Mehta

unread,
Jul 15, 2014, 3:44:00 AM7/15/14
to erpnext-dev...@googlegroups.com
You also have to rebuild (frappe -b) after this. All included files appear on the head section of the page. Check if your file is added.


--
Note:
 
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
 
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e42deacb-6ca0-4e46-8ce2-1433339afe1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rohit Waghchaure

unread,
Jul 15, 2014, 5:26:17 AM7/15/14
to erpnext-dev...@googlegroups.com
Hi Rushabh,

I have rebuild but still the included js file in not appeared on the head section of the page.

Thanks, Rohit 



For more options, visit https://groups.google.com/d/optout.



--
Rohit S. Waghchaure
Cell: +91 90118 57174 | Off. : (20) 657 0800 / 25281316
New Indictrans Technologies Pvt Ltd | www.indictranstech.com

Rushabh Mehta

unread,
Jul 15, 2014, 5:41:55 AM7/15/14
to erpnext-dev...@googlegroups.com
did you clear cache?

frappe --clear_cache


Reply all
Reply to author
Forward
0 new messages