引号不适用于jquery中的多行

时间:2015-06-22 14:17:31

标签: jquery

我试图将大量的html代码放在jquery中,使用倒置 逗号,但在换行后,引号不起作用,如何 要做到这一点,任何人都可以建议如何做到这一点.html代码写成追加

    $(document).ready(function(){
    $('#addmore').click(function(){
    $('#item').append("<div class='form-group'><label class='col-sm-4 '>Period</label><div class='col-sm-8'><div class='checkbox'><label><input type='checkbox' value='YES' name='currently_attending'>I`m currently attending this course</label></div><div class='row'><div class='col-xs-3'> Month<select class='span2  form-control' required name='from_month'><option value=''>Month</option><option value='Jan'>Jan</option>
                                          <option value='Feb'>Feb</option>
                                          <option value='March'>March</option>
                                          <option value='April'>April</option>
                                          <option value='May'>May</option>
                                          <option value='June'>June</option>
                                          <option value='July'>July</option>
                                          <option value='Aug'>Aug</option>
                                          <option value='Sept'>Sept</option>
                                          <option value='Oct'>Oct</option>
                                          <option value='Nov'>Nov</option>
                                          <option value='Dec'>Dec</option>
                                        </select>
                                      </div>
                                      <div class='col-xs-3'>
                                      Year
                                          <input type='text' class='form-control' placeholder='year' name='from_year' required pattern='[0-9]{4,4}'>
                                      </div>
                                      <span class='box'>
                                      <div class='col-xs-3'>
                                      Month
                                        <select class='span2 form-control'  name='to_month' >
                                          <option value=''>Month</option>
                                          <option value='Jan'>Jan</option>
                                          <option value='Feb'>Feb</option>
                                          <option value='March' >March</option>
                                          <option value='April'>April</option>
                                          <option value='May'>May</option>
                                          <option value='June'>June</option>
                                          <option value='July'>July</option>
                                          <option value='Aug'>Aug</option>
                                          <option value='Sept'>Sept</option>
                                          <option value='Oct'>Oct</option>
                                          <option value='Nov'>Nov</option>
                                          <option value='Dec'>Dec</option>
                                        </select>
                                      </div>
                                      <div class='col-xs-3'>
                                      Year
                                         <input type='text' class='form-control' placeholder='year' name='to_year'  >
                                      </div>
                                      </span>

                                      <div id='ab'></div>
                                    </div>
                                  </div>
                                </div>

                               <div class='cl'></div>
                                <div class='form-group'>
                                  <label class='col-sm-4'>Degree / Course title*</label>
                                  <div class='col-sm-8'>
                                    <input type='text' class='form-control ' name='title' required />
                                  </div>
                                </div>
                                   <div class='cl'></div>"
    });

    });

    $("#item").on("click",".delete", function(){
    $(this).closest(".form-group").remove();
    });

1 个答案:

答案 0 :(得分:1)

在每行的末尾添加一条黑色 #include<cstdio> #include<iostream> #include<stack> #include<cstring> using namespace std; int G[10][10],n; void dfs(int strt) { int vis[n]; memset(vis,0,sizeof vis); stack<int>st; st.push(strt); while(!st.empty()) { int pre=st.top();st.pop(); if(!vis[pre]) { cout<<pre<<" "; vis[pre]=1; for(int i=n-1;i>=0;i--) { if(G[pre][i]==1 and !vis[i]) { st.push(i); } } } } cout<<endl; } int main() { cin>>n; for(int i=0;i<n;i++) for(int j=0;j<n;j++) cin>>G[i][j]; dfs(2); } 。没有它在js

中无法解析多个行字符串

编辑:使用示例

\