Skip to content

Syntax error, unrecognized expression #32

@semaperepelitsa

Description

@semaperepelitsa

I'm trying to setup TopUp in my project. I've added the script to the page and added a class "top_up" to the photo links. And now when I click on an image I get the following alert:

Sorry, but the following error occured:

Error: Syntax error, unrecognized expression: ���

Here is the HTML of my gallery from Web Inspector:

<div class="photos gallery">
<a href="/uploads/BAhbBlsHOgZmSSIdNGZiY2IyZWQxZTE0M2U0ODc0MDAwMGZhBjoGRVQ?sha=e4981ef9" class="top_up" id="element_1"><img alt="" src="/uploads/BAhbB1sHOgZmSSIdNGZiY2IyZWQxZTE0M2U0ODc0MDAwMGZhBjoGRVRbCDoGcDoKdGh1bWJJIg0xNTB4MTEyIwY7BkY?sha=9e791dc1" id="element_0"></a>

<a href="/uploads/BAhbBlsHOgZmSSIdNGZiY2IyZWQxZTE0M2U0ODc0MDAwMGZjBjoGRVQ?sha=a1c99964" class="top_up"><img alt="" src="/uploads/BAhbB1sHOgZmSSIdNGZiY2IyZWQxZTE0M2U0ODc0MDAwMGZjBjoGRVRbCDoGcDoKdGh1bWJJIg0xNTB4MTEyIwY7BkY?sha=38c29957"></a>

<a href="/uploads/BAhbBlsHOgZmSSIdNGZiY2IyZWQxZTE0M2U0ODc0MDAwMGZlBjoGRVQ?sha=098881f7" class="top_up"><img alt="" src="/uploads/BAhbB1sHOgZmSSIdNGZiY2IyZWQxZTE0M2U0ODc0MDAwMGZlBjoGRVRbCDoGcDoKdGh1bWJJIg0xNTB4MTEyIwY7BkY?sha=2f56613b"></a>

<a href="/uploads/BAhbBlsHOgZmSSIdNGZiY2IyZWQxZTE0M2U0ODc0MDAwMTAwBjoGRVQ?sha=8f083af0" class="top_up"><img alt="" src="/uploads/BAhbB1sHOgZmSSIdNGZiY2IyZWQxZTE0M2U0ODc0MDAwMTAwBjoGRVRbCDoGcDoKdGh1bWJJIg0xNTB4MTEyIwY7BkY?sha=7d7444fb"></a>

</div>

I've also tried to use a preset instead and have no success either. Here is the javascript:

(function() {

  TopUp.images_path = "/assets/top_up/";

  TopUp.addPresets({
    ".gallery a": {
      effect: "clip"
    }
  });

}).call(this);

When I click on an image I get the following error in the console and then the image is opened as usual before TopUp.

TypeError: 'undefined' is not an object (evaluating 'topUp.element.attr("class").split')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions