I have problem with Require JS using prettyurl.
When i turn on prettyurl it in couch, the javascript file didn't load at subdomain only. But when i turn off the prettyurl it was fine.
Here is my app.js code:
My header code:
And prettyurl also turn the javascript into subdomain link i.e: mydomain.com/subdomain/js/app.js instead of mydomain.com/js/app.js. So it was not loading the javascript correctly at the subdomain link.
Here is the screenshot:
How to fix this?
Thankyou.
When i turn on prettyurl it in couch, the javascript file didn't load at subdomain only. But when i turn off the prettyurl it was fine.
Here is my app.js code:
- Code: Select all
"use strict";
//scripts availabel
require.config({
baseUrl: '',
paths: {
//PLUGINS
'jquery': 'vendor/jquery/jquery.min',
'plugins/modernizr': 'vendor/modernizr/modernizr',
'plugins/bootstrap_v3': 'vendor/bootstrap/v3/js/bootstrap.min',
'plugins/slick': 'vendor/slick/slick.min',
'plugins/progress': 'vendor/progress/dist/circle-progress.min',
'plugins/magnificPopup': 'vendor/magnificPopup/dist/jquery.magnific-popup.min',
'plugins/bridget': 'vendor/jquery/jquery-bridget',
'plugins/isotope': 'vendor/isotope/isotope.pkgd.min',
'plugins/datePicker': 'vendor/datePicker/js/datepicker',
//MODULES
'modules/main': 'js/modules/main',
'modules/player': 'js/modules/player',
'modules/progress': 'js/modules/progress',
'modules/upload': 'js/modules/upload',
'modules/userToggle': 'js/modules/user-toggle',
'modules/menu': 'js/modules/menu',
'modules/statistic': 'js/modules/statistic',
'modules/posts': 'js/modules/posts',
'modules/googleCharts': 'js/modules/google-charts',
'modules/datePicker': 'js/modules/datepicker',
},
shim : {
//PLUGINS
'plugins/modernizr': {
exports: 'Modernizr'
},
'plugins/bootstrap_v3': {
deps: ['jquery'],
exports: 'Bootstrap'
},
'plugins/datePicker': {
deps: ['jquery'],
exports: 'datePicker'
},
}
});
My header code:
- Code: Select all
<script data-main="js/app" src="<cms:show k_site_link/>vendor/require/require.js"></script>
And prettyurl also turn the javascript into subdomain link i.e: mydomain.com/subdomain/js/app.js instead of mydomain.com/js/app.js. So it was not loading the javascript correctly at the subdomain link.
Here is the screenshot:
How to fix this?
Thankyou.