简体   繁体   中英

(jQuery.js error) uncaught Error: Syntax error, unrecognized expression: [href=#]

I am having trouble with a WP plugin. Users cannot upload an avatar or background, as well as view their profile from the profile section. Once the button is pushed to perform profile related actions they are redirected to the home page. Here is a bit of the code (functions receiving errors) and pictures of the console log errors errors.

some console log errors are because there are no pictures. I have deliberately removed profile and background photos. This problem happens with or without images.

/*! jQuery v1.12.4 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0)
function(a){if(!a.document){throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,
function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=
function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:

I have performed the following Troubleshooting task:

  1. uninstalled and reinstalled the plugin.
  2. Adjusted all settings for redirects.
  3. Checked Themes (not the theme).
  4. Deleted everything and started from scratch.
  5. Deactivated all other plugins (plugins not the problem).

This is the Console log error for users attempting to change their background or avatar

The 2nd picture is of the console log error when an individual tries to view their profile

[href=#] is not a valid CSS selector.

In an attribute selector (the [name=value] syntax), the value MUST be surrounded by quotes UNLESS the value is a valid CSS identifier: starts with a letter, contains only letters, numbers, hyphens and underscores (in this case, quotes are optional)

Since # quite clearly fails the "valid CSS identifier", it must be quoted.

[href='#'] will work just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM