Javascript-js POST to PHP.

Source: Internet
Author: User

How to set a button, click on Post imagestr inside the array to PHP

$imageStr = "http://127.0.0.1/down/123.gif__http://127.0.0.1/down/8095680852_893f685cbd_q.jpg__http://127.0.0.1/down/8018953043_c6ef9e3b29_q.jpg__";

Before asking questions, please search for relevant answers:
Https://segmentfault.com/sear ...

Reply content:

How to set a button, click on Post imagestr inside the array to PHP

$imageStr = "http://127.0.0.1/down/123.gif__http://127.0.0.1/down/8095680852_893f685cbd_q.jpg__http://127.0.0.1/down/8018953043_c6ef9e3b29_q.jpg__";

Before asking questions, please search for relevant answers:
Https://segmentfault.com/sear ...

Example

$( "#lock_submit").click(function (){ var lock_form = $("#lock_form").serialize(); // 参数带在form里面用form表单 var onePush = "xxx/xxx/xxx.php" ; var imageStr ="http://127.0.0.1/down/123.gif__http://127.0.0.1/down/8095680852_893f685cbd_q.jpg__http://127.0.0.1/down/8018953043_c6ef9e3b29_q.jpg__";    $.ajax({        url: onePush ,        type:"POST",        data:{image:imageStr},//data:lock_form  form提交        dataType : "json",        success :function(data){            if(data.status== 1){                alert('操作成功')                // 刷选页面                location. reload();            }else{               alert('操作失败')            }        }    })})

Form submission is ready.

$.post (url,{imagestr: $imageStr},function (res) {

//do somethings

})

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.