Skip to Content Skip to Menu

Error: 'jQuery.validator' is null or not an object

  • czbok
  • czbok
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
13 years 6 months ago #161681 by czbok
Hi,

I got "'jQuery.validator' is null or not an object" error at the left bottom corner of my registration page:
www.cybercatalyst.com.au/testhosting/index.php?option=com_comprofiler&task=registers
in IE.

Other pages are working fine.


Error details:
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB6.6; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Thu, 21 Apr 2011 12:13:39 UTC


Message: 'jQuery.validator' is null or not an object
Line: 60
Char: 1
Code: 0
URI: www.cybercatalyst.com.au/testhosting/index.php?option=com_comprofiler&task=registers


Could anyone help me? Thanks in advance.

Please Log in or Create an account to join the conversation.

  • czbok
  • czbok
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
13 years 6 months ago #161738 by czbok
Can anyone help me?please

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
13 years 6 months ago #161748 by nant

czbok wrote: Can anyone help me?please


Sorry, I cannot replicate what you are seeing on my environment which is:

Joomla 1.5.22 or Joomla 1.6.1
CB 1.4
Default templates.

Please Log in or Create an account to join the conversation.

  • mev55
  • mev55
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
13 years 5 months ago #164331 by mev55
I have the same issue, and as nant pointed out, it was related to the template that is also using jQuery. In my case it was using a different version (1.3 rather than 1.5).

So I tried the following:
1) Replace the template jQuery.min.js file with the one from com_profiler - DID NOT WORK
2) Removed the one in the template folder - CB worked great!, but rest menus for website DID NOT WORK
3) Tried entering "<script type="text/javascript">jQuery.noConflict();</script>" prior to the script load of the template jQuery js file - DID NOT WORK

So, obviously the problem is conflicting jQuery file loads. Can any of the jQuery experts out there give any guidence? :unsure:

Please Log in or Create an account to join the conversation.

  • mev55
  • mev55
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
13 years 5 months ago - 13 years 5 months ago #164341 by mev55
Here is a workaround (although not pretty):

In the template php file that loads the jQuery file, replace the following:
Code:
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->document->template ?>/js/jquery.min.js"> </script>

with the following:
Code:
<script type="text/javascript"> //Check for jQuery already loaded if (typeof jQuery == 'undefined') { var loc = window.location.href.substring(0,(window.location.href.lastIndexOf("/")) + 1); var head = document.getElementsByTagName("head")[0]; script = document.createElement('script'); script.id = 'jQuery'; script.type = 'text/javascript'; script.src = loc + 'templates/templatename/js/jquery.min.js'; head.appendChild(script); } else { // jQuery is loaded already need not include it... } </script>

I'm sure there is a cleaner way to do this with php so that the template path does not have to be hardcoded.
Last edit: 13 years 5 months ago by mev55.

Please Log in or Create an account to join the conversation.

  • mev55
  • mev55
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
13 years 4 months ago - 13 years 4 months ago #165715 by mev55
Found a cleaner way provided by an expert over at JoomlaShack:

Replace the following:
Code:
<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->document->template ?> /js/jquery.min.js"> </script>

with the following:
Code:
<?php if (JRequest::getVar('option', '') != 'com_comprofiler') : ?> <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/ <?php echo $this->document->template ?>/js/jquery.min.js"></script> <?php endif; ?>
Last edit: 13 years 4 months ago by mev55.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum