2012-03-04 8 views
0

と私は "キャッチされないでSyntaxError:予期しない識別子" 取得していますライン上:ここ"キャッチされないでSyntaxError:予期しない識別子" アンバインド

$(‘form#GoogleForm’).unbind('submit').submit();

は私のjqueryのコードです:

$(function(){ 
//original field values 
var field_values = { 
     //id  : value 
     'fullname' : 'full name', 
     'companyname' : 'company name', 
     'email' : 'email address' 
}; 

$('#toggleCheck').change(function(){ 
    $('#toggleDiv').toggle(); 
}); 

//inputfocus 
$('input#companyname').inputfocus({ value: field_values['companyname'] }); 
$('input#fullname').inputfocus({ value: field_values['fullname'] }); 
$('input#email').inputfocus({ value: field_values['email'] }); 

//first_step 
$('form#GoogleForm').submit(function(){ return false; }); 
$('#submit_first').click(function(){ 
    //remove classes 
    $('#first_step input').removeClass('error').removeClass('valid'); 

    //ckeck if inputs aren't empty or invalid 
    var fields = $('#first_step input[type=text]'); 
    var emailPattern = /^[a-zA-Z0-9._-][email protected][a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; 
    var error = 0; 
    fields.each(function(){ 
     var value = $(this).val(); 
     if(value.length<2 || value==field_values[$(this).attr('id')] || ($(this).attr('id')=='email' && !emailPattern.test(value))) { 
      $(this).addClass('error'); 
      $(this).effect("shake", { times:3 }, 40); 

      error++; 
     } else { 
      $(this).addClass('valid'); 
     } 
    });   

    if(!error) { 
     //slide steps 
     $('#first_step').hide(); 
     $('#second_step').show();  
    } else return false; 

}); 

// second step 
$('#submit_second').click(function(){ 

    //prepare the third step 
    var fields = new Array(
     $('#fullname').val(), 
     $('#companyname').val(), 
     $('#email').val()      
    ); 
    var tr = $('#third_step tr'); 
    tr.each(function(){ 
     //alert(fields[$(this).index()]) 
     $(this).children('td:nth-child(2)').html(fields[$(this).index()]); 
    }); 

    //slide steps 
    $('#second_step').hide(); 
    $('#third_step').show();    
}); 

//third step 
$('#submit_third').click(function(){ 
    //send information to server 
    $(‘form#GoogleForm’).unbind('submit').submit(); 
}); 

}) ;

答えて

0

あなたが一重引用符を再入力すると、うまくいくと思います。今は違うキャラクターに見えます。

1

$(‘form#GoogleForm’).unbind('submit').submit();の行には、有効な引用符は使用していません。 ‘form#GoogleForm’の代わりに'form#GoogleForm'または"form#GoogleForm"を使用する必要があります。

関連する問題