标签: syntax-error

jQuery语法错误

$(document).ready(function(){
    $("#input_6_4\\.3_label").html("City/Borough");
    $("#input_6_8\\.3_label").html("City/Borough");

    $("#gform_next_button_6_42").click(function(){
        alert("hi");

    )};
});
Run Code Online (Sandbox Code Playgroud)

Firebug使用以上代码继续吐出语法错误,罪犯是这些字符:

)};
Run Code Online (Sandbox Code Playgroud)

什么是错的任何想法,因为代码对我来说似乎很好?

javascript jquery syntax-error

-2
推荐指数
1
解决办法
3961
查看次数

Java:请插入"}"以完成classbody

我写了一个小测试程序,但我在结束标签中遇到语法错误...

这是代码

public class Test 
{
    AudioFile file = null;
    String vbb = "";
    File f;

    public Test()
    {
        openFile();
    }   

    public File openFile()
    {
        JFileChooser fc = new JFileChooser();
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int result = fc.showOpenDialog(fc);
        if(result == JFileChooser.CANCEL_OPTION)
        {
            return null;
        } else {
            f = fc.getCurrentDirectory();
            return f;
        }
    }

    f = new File(openFile());
    File[] files = f.listFiles();

    for(File fi : files)
    {
        try {
            file = (AudioFile) AudioFileIO.read(new File(fi.getAbsolutePath()));
            MP3AudioHeader ah = (MP3AudioHeader) file.getAudioHeader();
            String time = ah.getTrackLengthAsString(); …
Run Code Online (Sandbox Code Playgroud)

java syntax class syntax-error

-2
推荐指数
1
解决办法
2074
查看次数

获取语​​法错误,提供所有代码

我对php和MySQL有些新意.我正在阅读教程并在单击编辑主题按钮时收到以下错误消息.我将包含我正在使用的所有适用代码.我很确定问题在于数据库连接,因为显示的错误是从connection.php页面打印的.

错误:

数据库连接失败:您的SQL语法中有错误; 检查与MySQL服务器版本对应的手册,以便在第1行的"1"附近使用正确的语法

数据库:

   I have 1 database(widget_corp) with 3 tables 
   Tables:
   subjects(id, menu_name, position, visible), 
   pages(id, subject_id, menu_name, position, visible, content), 
   users(id, username, hashed_password) //this one is not used yet
Run Code Online (Sandbox Code Playgroud)

源代码:

    <?PHP require_once("includes/connection.php"); ?>
    <?PHP require_once("includes/functions.php"); ?>
    <?PHP
    if(isset($_POST['submit'])) {
    $errors = array();
    $required_fields = array('menu_name', 'position', 'visible');
    foreach($required_fields as $fieldname) {
    if(!isset($_POST[$fieldname]) || (empty($_POST[$fieldname]) && !is_numeric($_POST[$fieldname]))) {
    $errors[] = $fieldname;
    }
    }
    $fields_with_lengths = array('menu_name' => 30);
    foreach($fields_with_lengths as $fieldname => $maxlength) {
    if(strlen(trim(mysql_prep($_POST[$fieldname]))) > $maxlength) { …
Run Code Online (Sandbox Code Playgroud)

php syntax-error

-2
推荐指数
1
解决办法
444
查看次数

使用速记if/else代码时出现语法错误

任何人都可以告诉我下面的速记if/else代码有什么问题吗?

<div class="holder <?php echo (!empty($bid_info['sale_price'] ? 'holder7' : 'holder4'); ?>">
Run Code Online (Sandbox Code Playgroud)

根据这个页面似乎是对的!?

虽然我收到以下错误:

Parse error: syntax error, unexpected '?', expecting ')' in ...........
Run Code Online (Sandbox Code Playgroud)

php shorthand-if syntax-error

-2
推荐指数
1
解决办法
134
查看次数

错误:期待';' 在括号之前

嘿伙计们,我的大脑已经正式进入所有这些项目,因为我似乎可以找出这个相对简单的错误.

所以我遇到的问题是它要求我在curli括号之前添加一个分号,这里是它发生的代码段.

bool IsAlive(int row, int col){
        return true;
    }
Run Code Online (Sandbox Code Playgroud)

它是在'col)之后问我一个分号.这是完整的代码

#include <iostream>
#include <windows.h>

#define NumGen 1
#define NumRows 13
#define NumCol 13

using namespace std;


void main()
{
    const int NumModRows=NumRows+2;
    const int NumModCol=NumCol+2;
    int grid[NumGen][NumModRows][NumModCol]={0};
    grid[NumGen][0][0]=5;
    //cout<<"Hey this is number "<<grid[NumGen][0][0]<<endl;
    //int upLeft=-1, upMid=-1, upRight=-1, left=-1, right=-1, botLeft=-1, botMid=-1, botRight=-1;
    //cout<<"All: "<<upLeft<<", "<<upMid<<", "<<upRight<<", "<<left<<", "<<right<<", "<<botLeft<<", "<<botMid<<", "<<botRight<<endl<<endl;
    //get input from user

    int rowInput;
    int colInput;
    int numInputs;
    cout<<"how many inputs will be inserted in the …
Run Code Online (Sandbox Code Playgroud)

c++ compiler-errors syntax-error

-2
推荐指数
1
解决办法
122
查看次数

Javascript语法错误[Node JS]

我正在学习nodeJS,我有这个语法错误,我不明白.有人可以指出什么是语法错误,为什么我会得到它,以及如何绕过它?

var http = require('http');
var url = require('url');
var server = http.createServer(function(req,res) {
    if (req.method == 'POST') {
        return res.end("Only get requests");
    }
    var st = url.parse(req.url,true);
    if (st.indexOf("parsetime") > -1) {
        var time = st.substring(st.indexOf("iso"));
        var date = new Date(time);
        var out = '{
            "hour":'+date.getHours()+',
            "minute":'+date.getMinutes()+',
            "second":'+date.getSeconds()+',
        }';
        res.writeHead(200, { 'Content-Type': 'application/json' });
        res.end(out);
    } else if (st.indexOf("unixtime") > -1) {
        var time = st.substring(st.indexOf("iso"));
        var date = new Date(time);
        var out = "{
            'unixtime':"+date.getTime()+"
        }";
        res.writeHead(200, { …
Run Code Online (Sandbox Code Playgroud)

javascript syntax syntax-error node.js

-2
推荐指数
1
解决办法
154
查看次数

PHP中出现意外的t字符串错误

这是错误:

解析错误:语法错误,第28行/home/kttoman/public_html/wp-config.php中的意外T_STRING

这是php文件的第28行:

define('DB_HOST', 'localhost’);
Run Code Online (Sandbox Code Playgroud)

当然它只是一点点,只是任何帮助或建议将是最有帮助的.

php wordpress syntax-error

-2
推荐指数
1
解决办法
885
查看次数

打印不在没有括号的情况下工作(Python 2.7)

当我在代码下面运行时,我得到"语法错误:语法无效".但是,如果我在打印后用括号运行此代码,我会得到正确的答案.

liczby = [
951, 402, 984, 651, 360, 69, 408, 319, 601, 485, 980, 507, 725, 547, 544,
615, 83, 165, 141, 501, 263, 617, 865, 575, 219, 390, 984, 592, 236, 105, 942, 941,
386, 462, 47, 418, 907, 344, 236, 375, 823, 566, 597, 978, 328, 615, 953, 345,
399, 162, 758, 219, 918, 237, 412, 566, 826, 248, 866, 950, 626, 949, 687, 217,
815, 67, 104, 58, 512, 24, 892, 894, 767, 553, 81, 379, …
Run Code Online (Sandbox Code Playgroud)

python printing compiler-errors syntax-error python-2.7

-2
推荐指数
1
解决办法
2068
查看次数

Python 3.6.0语法错误"调用'print'时缺少括号

我是一名游戏玩家,他决定要制作其他人可以玩的基本游戏.我对编码非常陌生并且对它有最基本的了解.我的堂兄和我正在尝试在Python 3.6.0中制作基于文本的游戏.我们在互联网上搜索了我们的问题的答案,但找不到任何东西.代码如下:


def start ():
    print ''' Welcome to the game! Created by Meme Buddha
type 'start' to begin'''
    print
    prompt_sta ()

def prompt_sta ():
    prompt_0 = input ('Type a Command, ')
    try:
        if prompt_0 == 'Start':
            outside_house ()
        elif prompt_0 == 'Begin':
            print 'You need to drink bleach and look at spicy memes!'
            print
            prompt_sta ()
        else:
            print 'Type Start, throw it on him not me,ugh,lets try something else!'
            print
            prompt_sta ()
    except ValueError:
        print 'Type Start, throw it …
Run Code Online (Sandbox Code Playgroud)

python syntax-error

-2
推荐指数
1
解决办法
5万
查看次数

我不知道如何解决此错误,python3语法错误“ def”

我想解决这个错误。我尝试了近半小时,但找不到答案。

这是我的错误

 File "sampling_fun.py", line 71
    def average(self) :
      ^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)

和完整的代码

import csv

class fun :
    def __init__(self, rowList, num) :
        list = []
        listLen = len(self.rowlist)-1
        for i in range(listLen) :
            list.append(self.rowList[i+1][num]  # num = Header 1~4

    def average(self) :
        ave = sum(self.list)/self.lestLen
        print("average : %0.2f" %ave)
        return ave

testlist = cssRead('Data_2', 1)
test1 = fun(testlist, 1)
test1.average()
Run Code Online (Sandbox Code Playgroud)

python function syntax-error python-3.x

-2
推荐指数
1
解决办法
79
查看次数