第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Sweet Alert 2 gem 確認(rèn)框按確定后重定向到鏈接

Sweet Alert 2 gem 確認(rèn)框按確定后重定向到鏈接

叮當(dāng)貓咪 2023-11-11 21:18:06
我不確定為什么“確定”或“取消”沒有做任何事情,無(wú)論如何我希望當(dāng)有人按“確定”將其重定向到鏈接時(shí)<div class="popup" onclick="sweetalertclick()">              <p id="center"><%= image_tag "pickup.png" ,width: "80px"%><br>                <span  onclick="sweetalertclick()"></span>Request a DDS pick u                </span>              </p>            </div>    <script>    function sweetalertclick() {        swal({        title: "Request a DDS",        text: "Please log in to DDS website to request a pick up, my code is: xxxx. By pressing ok you will link to google.com",        showCancelButton: true,        confirmButtonColor: "#DD6B55",        confirmButtonText: "Ok",        cancelButtonText: "Cancel",        closeOnConfirm: false,        closeOnCancel: false,      },      function(isConfirm){        if (isConfirm) {          window.location.href = "google.com"        }      }    );          }    </script>在寶石文件中g(shù)em 'rails-assets-sweetalert2', source: 'https://rails-assets.org'gem 'sweet-alert2-rails'gem 'sweet-alert-confirm'在 application.js 中//= require sweetalert2//= require jquery//= require jquery_ujs//= require sweet-alert2-rails//= require cocoon //= require sweet-alert-confirm  //= require_tree .在應(yīng)用程序.scss中 *= require_self *= require sweetalert2 *= require_tree . */
查看完整描述

1 回答

?
一只斗牛犬

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超2個(gè)贊

您必須使用.then()并在其中傳遞重定向過(guò)程:


例子:


function sweetalertclick() {


swal({

    title: 'Request a DDS',

    text: "Please log in to DDS website to request a pick up, my code is: xxxx. By pressing ok you will link to google.com",

    showCancelButton: true,

    confirmButtonColor: "#DD6B55",

    confirmButtonText: "Ok",

  }).then((result) => {

  console.log(result)

    if (result) {

      window.location.href = "google.com";

    }

  });

  

}


查看完整回答
反對(duì) 回復(fù) 2023-11-11
  • 1 回答
  • 0 關(guān)注
  • 137 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)