如何将JavaScript url链接链接到我的index.php页面

时间:2019-07-12 04:52:46

标签: javascript php

var feedback = function (res) {
    if (res.success === true) {
        var get_link = res.data.link.replace(/^http:\/\//i, 'https://');
        document.querySelector('.status').classList.add('bg-success');
        document.querySelector('.status').innerHTML =
        'Image : ' + '<br><input class="image-url" value=\"' + get_link + '\"/>' + '<img class="img" alt="Imgur-Upload" src=\"' + get_link + '\"/>';
    }
};

第二部分是:

new Imgur({
    clientid: '3527680b6690575', //You can change this ClientID
    callback: feedback
});

如何get_link到index.php页面中的php变量?

1 个答案:

答案 0 :(得分:0)

解决方案是这样的:

function notifvanish() {
    var data = 0;
    var dataset = 'set=' + data;
    $.ajax({
        type: "POST",
        url: "notifvanish.php",
        data: dataset,
        cache: false,
        success: function (html) {
            //alert("Success");
        }
    });
}