monu
Posts: 8
|
| Posted: 10/26/2011, 9:18 AM |
|
Hello Team,
I understand that by default client side Javascript code is inserted into the <head> section of the HTML of the page, and that's fine.
However, I have some complex functions which I want to re-use. I have tried putting these functions into the common Functions.js file. This works... but...
1) Is that the "correct" place to put common functions that I have written; and
2) If so, is there a feature in the IDE of CCS 4.3 that inserts functions into Functions.js, or should I just write them manually?
Many thanks,
Monu
|
 |
 |
datadoit
|
| Posted: 10/26/2011, 9:52 AM |
|
Put your own functions into your own file and reference it when needed.
ie: MyFunctions.js
|
|
|
 |
E43509
Posts: 283
|
| Posted: 10/26/2011, 10:01 AM |
|
Agree with datadoit.
I just add my .js files and include them
|
 |
 |
monu
Posts: 8
|
| Posted: 10/27/2011, 5:52 AM |
|
Many thanks,
Monu
|
 |
 |
monu
Posts: 8
|
| Posted: 10/30/2011, 4:29 AM |
|
One further question :)
Is there a way to enable my javascript file, e.g., myUtils.js, to show up in the IDE's project explorer?
Thanks,
Monu
|
 |
 |
datadoit
|
| Posted: 10/30/2011, 8:11 AM |
|
Yes, from the Project Explorer choose the Files tab instead of the Pages
tab. There you can see any and all files for your project.
Now as a feature request, I would like to see something added to the IDE
that would look for files with similar page names residing under the
same folder path, but with different extensions automatically open up in
the IDE when choosing the .ccp page from the Pages tab in Project Explorer.
Example:
MyPage.ccp (the designer)
MyPage.html (the HTML)
MyPage.php (the code)
MyPage_Events.php (custom code)
All of the above open automatically already.
MyPage.ccs (my own custom styles for the page)
MyPage.js (my own custom javascript for the page)
If these exist, then open those automatically also.
|
|
|
 |
monu
Posts: 8
|
| Posted: 10/30/2011, 10:14 AM |
|
Brilliant!
So easy when you know! 
Thanks,
M
|
 |
 |
|