1 Reply Latest reply on Dec 1, 2008 1:04 PM by mail.micke

    jQuery().slideToggle(),

    mail.micke

      Hi

      I'm trying to do some jQuery stuff but get this error:

      fn is not a function
      https://localhost:6002/a4j/g/3_2_2.GAjquery.js.jsf
      Line 1776
      


      The code I'm trying to execute looks like this:
      function toggleAgrTbl(imgId, tableId){
       tableId = '#'+tableId;
       jQuery(tableId).slideToggle('fast');
      }
      


      Things like this work :
      function toggleAgrTbl(imgId, tableId){
       jQuery('a').addClass('blue');
      }
      


      Have this in head:
      <a4j:loadScript src="resource://jquery.js"/>
      


      I've checked via FireBug that the jquery.js is included and also verified that the slideToggle function is defined in there.

      Any ideas?

      Cheers,
      micke


        • 1. Re: jQuery().slideToggle(),
          mail.micke

          Just managed to figure it out, didn't escape properly!

          In case someone else has a similar problem:

          I had to "double" escape:

          onclick="toggleAgrTbl('agrTbl1\\\\:#{rowKey}\\\\:toggleImg', 'agrTbl1\\\\:#{rowKey}\\\\:subTbl1');"