Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
357 views
in Technique[技术] by (71.8m points)

javascript - 通过Ajax发送Indside ul数据(Send Indside ul data by ajax)

How would you send ul->li data in a form by Ajax.

(您将如何以Ajax的形式发送ul-> li数据。)

I want to send all the data in ul ->li by ajax and jquery.

(我想通过ajax和jquery发送ul-> li中的所有数据。)

  <form id="rightData" method="POST">
                        <ul class="list-group" id="accordian">

                            <!-- right list  -->

                        </ul>
                        <input type="submit" value="submit" name="submit">
                    </form>

JS Pushing list from json in UL

(UL中来自JSON的JS推送列表)

  $.getJSON('https://api.myjson.com/bins/d6n2a', function (data) {
            data.topic_info.qt_ct_connection.map(value => {
                value.ct_list.forEach((CTLIST, index) => {

                    $tBody.append(`<li class="list-group-item" id="rl">${CTLIST.ct}
                    <p id=${index}class="show">

                            <a href="#demo_${CTLIST.ct}" class="btn btn-danger" data-toggle="collapse">Simple collapsible</a>
                                <div id="demo_${CTLIST.ct}" class="collapse">
                          <label>${Object.keys(CTLIST)[2]}</label> <input type="text" value="${CTLIST.tts}><br>
                          <label>${Object.keys(CTLIST)[1]}</label> <input type="text" value="${CTLIST.topic_level}"><br> 
                            <label>${Object.keys(CTLIST)[4]}</label> <input type="checkbox" ${(CTLIST.to_be_shown_individually && 'checked')}  > <br>

                          <label>${Object.keys(CTLIST)[3]}</label><input type="checkbox" ${(CTLIST.check_for_geometry && 'checked')}  > <br>
                           </div>        
                    </p>
                    </li>`);



                });

how can i use post method to send data un everly

(我如何使用邮政方法永远发送数据)

in one click of submit

(一键提交)

  ask by Ritik Singh translate from so


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...