title: Uncaught SyntaxError: Invalid or unexpected token load-scripts.php:343 - Wordpress Widgets
body: <p>I ran into a problem and I'm hoping a dev can help me out. I went into the dashboard of my wordpress site and then to widgets and noticed a problem. None of the drop downs or drag and drops work. I checked the console and found this error:</p>
  
  <pre><code>"Uncaught SyntaxError: Invalid or unexpected token load-scripts.php:343"
  </code></pre>
  
  <p>Here is a screenshot:</p>
  
  <p><a href="https://i.stack.imgur.com/JyLDs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JyLDs.jpg" alt="enter image description here"></a></p>
  
  <p>Here is the line of code for load-scripts.php:343 when clicked on</p>
  
  <pre><code>!function(a,b,c,d){"use strict";var e={},f={};b.mce=b.mce||{},b.mce.views={register:function(a,c){e[a]=b.mce.View.extend(_.extend(c,{type:a}))},unregister:function(a){delete e[a]},get:function(a){return e[a]},unbind:function(){_.each(f,function(a){a.unbind()})},setMarkers:function(a){var b,c,d=[{content:a}],f=this;return _.each(e,function(a,e){c=d.slice(),d=[],_.each(c,function(c){var g,h,i=c.content;if(c.processed)return void d.push(c);for(;i&amp;&amp;(g=a.prototype.match(i));)g.index&amp;&amp;d.push({content:i.substring(0,g.index)}),b=f.createInstance(e,g.content,g.options),h=b.loader?".":b.text,d.push({content:b.ignore?h:'&lt;p data-wpview-marker="'+b.encodedText+'"&gt;'+h+"&lt;/p&gt;",processed:!0}),i=i.slice(g.index+g.content.length);i&amp;&amp;d.push({content:i})})}),a=_.pluck(d,"content").join(""),a.replace(/&lt;p&gt;\s*&lt;p data-wpview-marker=/g,"&lt;p data-wpview-marker=").replace(/&lt;\/p&gt;\s*&lt;\/p&gt;/g,"&lt;/p&gt;")},createInstance:function(a,b,c,d){var e,g,h=this.get(a);return b=tinymce.DOM.decode(b),b.indexOf("[")!==-1&amp;&amp;b.indexOf("]")!==-1&amp;&amp;(b=b.replace(/\[[^\]]+\]/g,function(a){return a.replace(/[\r\n]/g,"")})),!d&amp;&amp;(g=this.getInstance(b))?g:(e=encodeURIComponent(b),c=_.extend(c||{},{text:b,encodedText:e}),f[e]=new h(c))},getInstance:function(a){return"string"==typeof a?f[encodeURIComponent(a)]:f[d(a).attr("data-wpview-text")]},getText:function(a){return decodeURIComponent(d(a).attr("data-wpview-text")||"")},render:function(a){_.each(f,function(b){b.render(null,a)})},update:function(a,b,c,d){var e=this.getInstance(c);e&amp;&amp;e.update(a,b,c,d)},edit:function(a,b){var c=this.getInstance(b);c&amp;&amp;c.edit&amp;&amp;c.edit(c.text,function(d,e){c.update(d,a,b,e)})},remove:function(a,b){var c=this.getInstance(b);c&amp;&amp;c.remove(a,b)}},b.mce.View=function(a){_.extend(this,a),this.initialize()},b.mce.View.extend=Backbone.View.extend,_.extend(b.mce.View.prototype,{content:null,loader:!0,initialize:function(){},getContent:function(){return this.content},render:function(a,b){null!=a&amp;&amp;(this.content=a),a=this.getContent(),(this.loader||a)&amp;&amp;(b&amp;&amp;this.unbind(),this.replaceMarkers(),a?this.setContent(a,function(a,b){d(b).data("rendered",!0),this.bindNode.call(this,a,b)},!!b&amp;&amp;null):this.setLoader())},bindNode:function(){},unbindNode:function(){},unbind:function(){this.getNodes(function(a,b){this.unbindNode.call(this,a,b)},!0)},getEditors:function(a){_.each(tinymce.editors,function(b){b.plugins.wpview&amp;&amp;a.call(this,b)},this)},getNodes:function(a,b){this.getEditors(function(c){var e=this;d(c.getBody()).find('[data-wpview-text="'+e.encodedText+'"]').filter(function(){var a;return null==b||(a=d(this).data("rendered")===!0,b?a:!a)}).each(function(){a.call(e,c,this,this)})})},getMarkers:function(a){this.getEditors(function(b){var c=this;d(b.getBody()).find('[data-wpview-marker="'+this.encodedText+'"]').each(function(){a.call(c,b,this)})})},replaceMarkers:function(){this.getMarkers(function(a,b){var c,e=b===a.selection.getNode();return this.loader||d(b).text()===this.text?(c=a.$('&lt;div class="wpview wpview-wrap" data-wpview-text="'+this.encodedText+'" data-wpview-type="'+this.type+'" contenteditable="false"&gt;&lt;/div&gt;'),a.$(b).replaceWith(c),void(e&amp;&amp;setTimeout(function(){a.selection.select(c[0]),a.selection.collapse()}))):void a.dom.setAttrib(b,"data-wpview-marker",null)})},removeMarkers:function(){this.getMarkers(function(a,b){a.dom.setAttrib(b,"data-wpview-marker",null)})},setContent:function(a,b,c){_.isObject(a)&amp;&amp;(a.sandbox||a.head||a.body.indexOf("&lt;script")!==-1)?this.setIframes(a.head||"",a.body,b,c):_.isString(a)&amp;&amp;a.indexOf("&lt;script")!==-1?this.setIframes("",a,b,c):this.getNodes(function(c,d){a=a.body||a,a.indexOf("&lt;iframe")!==-1&amp;&amp;(a+='&lt;span class="mce-shim"&gt;&lt;/span&gt;'),c.undoManager.transact(function(){d.innerHTML="",d.appendChild(_.isString(a)?c.dom.createFragment(a):a),c.dom.add(d,"span",{"class":"wpview-end"})}),b&amp;&amp;b.call(this,c,d)},c)},setIframes:function(a,c,e,f){var g=this;this.getNodes(function(f,h){function i(){var a;r||l.contentWindow&amp;&amp;(a=d(l),g.iframeHeight=d(n.body).height(),a.height()!==g.iframeHeight&amp;&amp;(a.height(g.iframeHeight),f.nodeChanged()))}function j(){f.isHidden()||(d(h).data("rendered",null),setTimeout(function(){b.mce.views.render()}))}function k(){p=new o(_.debounce(i,100)),p.observe(n.body,{attributes:!0,childList:!0,subtree:!0})}var l,m,n,o,p,q,r,s=f.dom,t="",u=f.getBody().className||"",v=f.getDoc().getElementsByTagName("head")[0];if(tinymce.each(s.$('link[rel="stylesheet"]',v),function(a){a.href&amp;&amp;a.href.indexOf("skins/lightgray/content.min.css")===-1&amp;&amp;a.href.indexOf("skins/wordpress/wp-content.css")===-1&amp;&amp;(t+=s.getOuterHTML(a))}),g.iframeHeight&amp;&amp;s.add(h,"span",{"data-mce-bogus":1,style:{display:"block",width:"100%",height:g.iframeHeight}},"\u200b"),f.undoManager.transact(function(){h.innerHTML="",l=s.add(h,"iframe",{src:tinymce.Env.ie?'javascript:""':"",frameBorder:"0",allowTransparency:"true",scrolling:"no","class":"wpview-sandbox",style:{width:"100%",display:"block"},height:g.iframeHeight}),s.add(h,"span",{"class":"mce-shim"}),s.add(h,"span",{"class":"wpview-end"})}),l.contentWindow){if(m=l.contentWindow,n=m.document,n.open(),n.write('&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;'+a+t+'&lt;style&gt;html {background: transparent;padding: 0;margin: 0;}body#wpview-iframe-sandbox {background: transparent;padding: 1px 0 !important;margin: -1px 0 0 !important;}body#wpview-iframe-sandbox:before,body#wpview-iframe-sandbox:after {display: none;content: "";}iframe {max-width: 100%;}&lt;/style&gt;&lt;/head&gt;&lt;body id="wpview-iframe-sandbox" class="'+u+'"&gt;'+c+"
  </code></pre>
  
  <p>Here is a screenshot after I click on the error:</p>
  
  <p><a href="https://i.stack.imgur.com/CYoF7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CYoF7.jpg" alt="enter image description here"></a></p>
  
  <p>Not sure how to pursue this further. I've done all the turn off plugins and such to no avail. Any help would be appreciated fr this newb. Thanks.</p>