Unable to load JS file

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



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-forum+un…@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.
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.


On 15-Jul-2014, at 12:50 pm, Rohit Waghchaure <ro...@indictranstech.com> wrote:

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



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-forum+un…@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.



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1A69E9B2-F1DC-4B5E-9E4E-02C2854600C8%40gmail.com.

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

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

Thanks, Rohit


On Tue, Jul 15, 2014 at 1:13 PM, Rushabh Mehta <rm...@gmail.com> wrote:
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.



On 15-Jul-2014, at 12:50 pm, Rohit Waghchaure <ro...@indictranstech.com> wrote:

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



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-forum+un…@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.




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-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1A69E9B2-F1DC-4B5E-9E4E-02C2854600C8%40gmail.com.

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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAFsi8V39YwnCJkRuO2bDC8_nXp%2B_YZ75FNsHdYCgoALMzy03Cw%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.
did you clear cache?

frappe --clear_cache


On 15-Jul-2014, at 2:56 pm, Rohit Waghchaure <ro...@indictranstech.com> wrote:

Hi Rushabh,

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

Thanks, Rohit 


On Tue, Jul 15, 2014 at 1:13 PM, Rushabh Mehta <rm...@gmail.com> wrote:
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.



On 15-Jul-2014, at 12:50 pm, Rohit Waghchaure <ro...@indictranstech.com> wrote:

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



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-forum+un…@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.





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-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1A69E9B2-F1DC-4B5E-9E4E-02C2854600C8%40gmail.com.

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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAFsi8V39YwnCJkRuO2bDC8_nXp%2B_YZ75FNsHdYCgoALMzy03Cw%40mail.gmail.com.

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



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-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/5A4FE1BF-DB02-4744-8764-3F01D4DEF8AB%40gmail.com.

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