Christopher Rohde
Christopher Rohde

Reputation: 1

Uncaught Error: Syntax error, unrecognized expression - After WordPress Update

After updating WordPress to Version 4.6 (jQuery Update), this File is not more Working. With the old jQuery its working.

function _removerlay (object) {
  jQuery('#x-widgets-list .loader').remove();
   var _elem1 = "<div id='x-pbwp-outerlay'></div>",
       _elem2 = "<div id='x-widgets-list'></div>";
   $elem = object.closest("div[class*='x-wrapp-class-']") ;
   $elem.unwrap(_elem2);
   $elem.unwrap(_elem1);
   $elem.hide()
}

function _createpopshort (object) {
    var _structure = "<div id='x-pbwp-outerlay'><div id='x-widgets-list'></div></div>",
    $elem = jQuery('#x-widgets-list');
    var a = object.closest(".column-in").next();
    jQuery(a).wrap(_structure).delay(100).fadeIn(150);
}

Error in Console:

Uncaught Error: Syntax error, unrecognized expression:

Upvotes: 0

Views: 537

Answers (1)

epascarello
epascarello

Reputation: 207521

unwrap expects a selector, not a string that looks like an element

var _elem1 = "#x-pbwp-outerlay",
    _elem2 = "#x-widgets-list";

Upvotes: 0

Related Questions