Skip to main content
1 of 6
Doug
  • 587
  • 3
  • 15

JQuery does not work in channel form, get 'syntax error: Unexpected token

This may not be an issue with ExpressionEngine, but I'll start here and with the reference to some EE code.

I'm using Channel Form to post entries from the front end. It works fine locally, but on the development and production server JQuery isn't working: Channel images, WYGWAM, Tagger, and/or Grid....BUT only on some systems using Safari.

I get the following error:

[Error] SyntaxError: Unexpected token '<' (www.example.com, line 40)

When I hover over the "www.example.com, line 40 part I see:

http: //www.example.com/ACT=10?&ui=core,widget,mouse,position dragable, resizable, etc, etc,....&include_jquery=y:40

If I click on the link to the code where there error is I see this block:

$(".markItUpHeader ul").prepend('<li class="close_formatting_buttons"><a href="#"><img width="10" height="10" src="' +
EE.THEME_URL + 'images/publish_minus.gif" alt="Close Formatting Buttons"/></a></li>');
$(".close_formatting_buttons a").toggle(function() {
    $(this).parent().parent().children(":not(.close_formatting_buttons)").hide();
    $(this).parent().parent().css("height", "13px");
    $(this).children("img").attr("src", EE.THEME_URL + "images/publish_plus.png")
}, function() {
    $(this).parent().parent().children().show();
    $(this).parent().parent().css("height", "auto");
    $(this).children("img").attr("src", EE.THEME_URL + "images/publish_minus.gif")
});

Not sure where to go on this one. Does not work on dev/production when using Safari on at least two Macs (both 10.9). It works locally, works dev/production when using Chrome, works in Windows (Parallels) using Firefox and Chrome, also works on dev/production when using another Mac I have access to (not sure what version of OSX).

The only connection I can think of is the two computers/browsers it does NOT work are the two that I had used to post entries.

Any help or ideas where to look for help much appreciated.

Doug
  • 587
  • 3
  • 15