JQuery FIX: uncaught exception: Syntax error, unrecognized expression: #

Leave a comment Standard

This one threw me for a bit of a loop today so I thought I’d share. I couldn’t get my debugger to give me a line number for this error, however it turns out I had a double # sign in my jQuery code.

<script>
$("##myButton").click(function () { alert('You are pressing my buttons'); });
</script>

Notice the duplicate pound sign (#) in the ID reference for the button. Remove the duplicate pound sign and you should be good to go.

Advertisements

DOJO Grid FIX: Showing/Hiding Grid Causes Grid Headings To Disappear

Leave a comment Standard

DOJO has a quirky problem if you try to show/hide grids using Javascript or JQuery. This is especially trying if you have multiple grids on a page and you only want to display one at a time. If your column headers aren’t “fixed” they disappear once you hide the grid and then try to display it again.

The only way around this is to use the .resize() method on the grid reference after you try to show it again. This re-draw the grid with all the columns showing up again.

<script>

$("#showSubGridButton").click(function() {
    $("#mainGridContainer").hide();
    $("#subGridContainer").show();
    refreshGrid(subGrid);
});
$("#showMainGridButton").click(function() {
    $("#subGridContainer").hide();
    $("#MainGridContainer").show();
    refreshGrid(mainGrid);
});
function refreshGrid(gridRef) {
   gridRef.resize();
}
</script>

MySQL Workbench FIX: Cannot start SSH tunnel manager error — even when using TCP/IP connections

Comment 1 Standard

I recently ran into this problem when I updated to the newest version of Tortoise SVN. This error was happening every time I tried to connect to a server, even if I wasn’t using SSH. So apparently when you update your SVN and it’s one that uses Python it sometimes removes a necessary system environment variable. So there are two potential solutions but only the second one worked for me.

Solution One – Fix the system environment variable

  1. Go to your start menu and right click on My Computer
  2. Select properties
  3. Click on the advanced tab
  4. Click on the Environment Variables button at the bottom
  5. In the system variables look for one that says PYTHONHOME
  6. If you find it, update the path to the location of where you installed workbench, to the python folder. For instance mine is C:\Program Files\MySQL\MySQL Workbench 5.2 CE\python
  7. If you don’t find it, then you need to add one with a variable name of PYTHONHOME and the path to the python folder in workbench
  8. Hit OK when you’re done
  9. Restart your computer

Solution Two – Uninstall and re-install MySQL Workbench

This is the only one that worked for me so I think my SVN changed more than just my system variable. Once I re-installed MySQL Workbench it and SVN were worked without problems.