开发者

Why am I getting the error Missing ; before statement

开发者 https://www.devze.com 2023-03-02 00:15 出处:网络
I have some very simple code but I am getting the aforementioned error, any ideas why? Here is the code:

I have some very simple code but I am getting the aforementioned error, any ideas why?

Here is the code:

function ch开发者_StackOverflowangeSlides(new_slide) {

    ${'#app_dev'}.toggle('blind', 500);

}


Change ${'#app_dev'} to $('#app_dev')

$ is a function and needs to be called like one.


Use parentheses instead of curly brackets for the $ method:

$("#app_dev").toggle("blind", 500);


You need to use paras

function changeSlides(new_slide) {

    $('#app_dev').toggle('blind', 500); //switch { to )

}


The jquery selector function uses parentheses () not curly brackets {}

function changeSlides(new_slide) {

    $('#app_dev').toggle('blind', 500);

}


Wrong brackets, it should be: $('#app_dev')

0

精彩评论

暂无评论...
验证码 换一张
取 消