java script not needed but still exists in category page

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

java script not needed but still exists in category page

Post by newart » Thu Feb 14, 2008 11:30 am

I've disabled all titles in a category list of articles, so you do not want a sort by some-order...

I've seen in the source code of the page that some java stuffs is still present, an example is:

" <script language="javascript" type="text/javascript">

function tableOrdering( order, dir, task )
... and so on"

What I can say is that the java script has been loaded even if it isn't needed!
former Q&T WorkGroup Joomla member - Italian Translation Team Member

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: java script not needed but still exists in category page

Post by newart » Sat Feb 16, 2008 3:31 pm

Here is the problem, in the path ...\components\com_content\views\category\tmpl
in the file default_items.php you can see the following java code, in the first code lines with no conditional if clause, or whatever needed for avoiding its downloading when all sort features are disabled. It isn't a bug, there is no error or bad joomla behaviour... it's more or less a sort of not-clean-code... I don't know how to describe that. But please see what inside in that file:

Code: Select all

<?php // no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<script language="javascript" type="text/javascript">

	function tableOrdering( order, dir, task )
	{
		var form = document.adminForm;

		form.filter_order.value 	= order;
		form.filter_order_Dir.value	= dir;
		document.adminForm.submit( task );
	}
</script>
<form action="<?php echo $this->action; ?>" method="post" name="adminForm">
former Q&T WorkGroup Joomla member - Italian Translation Team Member

juankysmith
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Aug 27, 2008 11:52 am

Re: java script not needed but still exists in category page

Post by juankysmith » Thu Mar 05, 2009 11:03 am

Hello!

i am having the same problem, can i see how you use this function??

thank u!!

User avatar
newart
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3177
Joined: Fri Sep 02, 2005 10:06 am
Location: Solar system - Earth - European Union

Re: java script not needed but still exists in category page

Post by newart » Sat Mar 07, 2009 3:21 pm

if you don't use any functions, well, you can simply delete those code lines
former Q&T WorkGroup Joomla member - Italian Translation Team Member


Locked

Return to “Joomla! 1.5 Coding”