亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - How to bring parameters in $.get request so that serverLet can receive data?
僅有的幸福
僅有的幸福 2017-05-19 10:35:13
0
2
624

Specific business scenario:
When I click the button, I will use the $.get method to request a pop-up page. After filling in the content of the pop-up page, I click the confirmation button in the pop-up window and need to pass parameters to the server. What should you do in this situation?

demo address

Directory Structure:

index.js code:

var bground = $('<p class="dialog-bg"><p class="btn-group"></p></p>');
var sure_btn = $("<button>確認(rèn)</button>");
var off_btn = $("<button>取消</button>");

$(".btn").on("click",function(){
          alert("1");
        var sUrl = "../snippet/child.html";
  $(".btn-group").append(sure_btn).append(off_btn);
  $.get(sUrl,function(obj){
    var full = bground.append(obj);
    $(document).append(full);
  });
});

// 確認(rèn)按鈕
sure_btn.on("click",function(){
  
});

// 取消按鈕
off_btn.on("click",function(){
  
});
僅有的幸福
僅有的幸福

reply all(2)
給我你的懷抱

I don’t quite understand the meaning of the question. What’s the problem?
After append after $.get(), after filling in, just submit the form directly

  $.get(sUrl,function(obj){
    var full = bground.append(obj);
    $(document).append(full);
    //提交表單(偽代碼)
    let user = $('#user').value;
    $('#submit').click(()=>{$.ajax({........}).then()})
  });
過去多啦不再A夢(mèng)

If two parameters, name and age, are passed, sUrl="../snippet/child.html?name=tom&age=18";
This?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template