PDA

View Full Version : app.js and index.html must been placed in the same folder?



fanggy
3 Oct 2012, 10:30 PM
hi, evryone.
I am new to Extjs4. I generated a MVC app on python framwork django. It didn't work if I placed app.js and index.html file in different folders.
Thanks in advance.

a.premkumar
3 Oct 2012, 11:22 PM
I don't know about django. But generally speaking, it is not necessarily to place app.js in same folder where index.html resides. All you have to look after is to map the file with correct path in your index.html files.

for example if you have placed the app.js in a sub folder 'ex', and this folder ex is placed in the same folder as index.html, you can map your app.js as



<script type="text/javascript" src="ex/app.js"></script>


I hope this helps.

Regards,
Premkumar. A

fanggy
3 Oct 2012, 11:38 PM
Thank for your reply. I modified directly on Extjs4 example and changed js reference directory, but it didn't work.

I don't know about django. But generally speaking, it is not necessarily to place app.js in same folder where index.html resides. All you have to look after is to map the file with correct path in your index.html files.

for example if you have placed the app.js in a sub folder 'ex', and this folder ex is placed in the same folder as index.html, you can map your app.js as



<script type="text/javascript" src="ex/app.js"></script>


I hope this helps.

Regards,
Premkumar. A

fanggy
4 Oct 2012, 12:11 AM
I found the problem. I deploy extjs4 on django, so I must change appFolder.