简体   繁体   中英

reframe iframe after ajax

How to refresh the iframe after ajax response success?

success: function (res) {       
            if (res.IsSuccess) {
                setTimeout(function () {
                $("#divLoading").hide();
                }, 2000);
                $(".modal-iframe1").attr("src", window.url.OnlineSignUrl + res.Response[0].DocumentID + "&AuthToken=" + AuthToken);
                window.location.reload();
            }else{
                alert(res.Messages);
                window.location.href='/PdfLogin.html';
            }

Here if i give window.location.reload() it is loading the entire web page, Instead of loading entire web page, hoew to load iframe only?

Note: More code! Please check the below image for more clarification image

Here several icon is there in .pdf search link[whereever the pdf link is there] So if i click the first icon, i calling the iframe to load the content and signing activity pdfimage2iframepopup , once it is done i'm selecting the second image, so here the iframe is not loading it is taking the first selected image values?

window.location.reload(); will reload the entire web-page as you've already discovered.

All you need to do is change the src attribute of the iframe . That will cause it to reload.

$(".modal-iframe1").attr("src", window.url.OnlineSignUrl + res.Response[0].DocumentID + "&AuthToken=" + AuthToken);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM