RE: Javascript in theme does not include

thumbnail
Zsolt - Jácint Balogh, modified 11 Years ago. Junior Member Posts: 91 Join Date: 10/9/13 Recent Posts
Hi guys,

I created a big javascript file and I added it to my theme.
I included it in the portal_normal.vm and it works just fine but now my file is quite a big and I want to separate the parts. So I created 3 js file from the big one, I included each 3 file in the portal_normal.vm but I can see only the first file included to the page.

I don't know what is the problem and I'm going crazy because I spent more then a half day doing this.

Here is my portal_normal.vm file

	<title>$the_title - $company_name</title>

	<meta content="initial-scale=1.0, width=device-width" name="viewport">

	$theme.include($top_head_include)
	
	##Jquery plugin. 
	<script src="$javascript_folder/jquery/jquery-1.9.1.min.js"></script>
	##Google plugin used for autocomplete. Maybe can be used for the googple maps portlet too
	<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&amp;libraries=places"></script>
	##Autocomplete plugin
	<script src="$javascript_folder/autocomplete/googleautocomplete.js"></script> ##included
	<script src="$javascript_folder/autocomplete/streetportlet.js"></script>              ## not included
	<script src="$javascript_folder/autocomplete/submissionportlet.js"></script>     ## not included
	



On the file system and on the deployed war file all the three file are present on the same folder.
No error message in the firebug. (except the missing function definition)


The modifications in the googleautocomplete.js are present.
I cleared the cache of the browser and I tried in other browsers but the problem still exist.
I cleared my tmp folder, undeployed the theme and redeployed the theme and restarted the server many times but no success...
I tried it in other machine but still not working.


I'm using
Liferay 6.2-ga2
Jboss 7.1.1

What can be the problem?

Any help, hint are really appreciated!
Regards,
Zsolt
thumbnail
Zsolt - Jácint Balogh, modified 11 Years ago. Junior Member Posts: 91 Join Date: 10/9/13 Recent Posts
I don't know why but the problem was that I closed the script tag with /> instead of
</script>

So if somebody has the same problem first try to close the javascript tag with </script> instead of />
emoticonemoticonemoticonemoticon

Edit: if somebody can give me an explanation that should be great.