Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
The following keeps throwing out an Uncaught SyntaxError: Unexpected token { and I can't see what's wrong with it??
$(window).resize(function(){
if ($("a.burger-menu").is(":hidden") {
$("nav a").show();
}
});
Can anyone help?
Many Thanks
You have not closed the if() condition.Try this:
$(window).resize(function(){
if ($("a.burger-menu").is(":hidden")) {
$("nav a").show(); // ^ That was missing.
}
});
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I get the following error with the Hello world syntax in the Google Chrome Development Console.
JavaScript
console.log("Hello World');
Error Message
Uncaught SyntaxError: Invalid or unexpected token
Could you tell me the cause?
you have open your text with double quotes and close with single qoation markā¦
console.log("Hello World");
works fine
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
I need to add class to all the links that have "href=login". And i tried to use this javascript
jQuery(document).ready(function($){
$(.pageWidth).find('a[href*="/login/"]').addClass('OverlayTrigger');})
Unfortunately, i tried so many times and it always getting this error
Uncaught Syntax Error: Unexpected token
How can i fix this? What's the problem here?
Thank you!
You are missing quotes in your jQuery selector:
jQuery(document).ready( function($) {
$('.pageWidth').find('a[href*="/login/"]').addClass('OverlayTrigger');
} )
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
i need some help here.
this problem happens on some computer only not all.
ReferenceError'$j' is undefined
http://www.xxx.xxx/view.js:1:1Global code
ReferenceError'$j' is undefined
http://www.xxxxxx.org/view.js:1:1Global code
$j(function(){
$("form.appnitro").data('active_element','');
var field_highlight_color = $("form.appnitro").data('highlightcolor');
//attach event handler to all form fields, to highlight the selected list (except for matrix field)
$("form.appnitro :input").bind('click focus',function(){
var current_li = $(this).closest("li").not('.matrix').not('.buttons');
Change
$j(function(){
to
$(function(){
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I keep on getting an error message in the chrome console saying that there is an uncaught syntax error. Anybody has any solutions? I am a beginner with JQuery
jQuery(function($) {'use strict',
//#main-slider
$(function(){
$('#main-slider.carousel').carousel({
interval: 8000
});
});
You have two errors:
The comma (,) after 'use strict' should be a semicolon (;).
You need a closing }); to match the outermost call to jQuery.
Just do:
//#main-slider
$(function(){
$('#main-slider.carousel').carousel({
interval: 8000
});
});
You don't need the other stuff like the JQuery(), from my understanding it's essentially the same as doing $(function(){})
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I have the following syntax:
And am receiving the following error on line 6:
Uncaught SyntaxError: Unexpected token {
I read the api docs on done() and I can't see what I am doing wrong here.
$.post(path).done(funtion(data) { ....
^----notice any missing characters here, a "c" perhaps?
JS is trying to call a function called "funtion", which means that the { afterwards is illegal syntax. Since it parses out that syntax error first, it doesn't get to the point of being to able to tell you that "funtion" doesn't exist.
You wrote funtion instead of function.
$.post(path).done(function(data) { console.log(data) });