[英]How to load the another page on ajax success function
我需要在ajax成功函數上加載另一個頁面。
我有兩個文件,即file1
和file2
。 在file1
ajax成功函數上加載file2
。
您可以使用iframe加載其他任何頁面內容。
創建一個iframe並給它css display:none;
”。 然后,在成功函數中調用ajax時,請執行以下操作:
$('iframe').attr('src', yoururl)
$('iframe').show();
在javascript中重定向使用
window.location.href ="http://google.com";
或在jquery中使用.load()
$( "#result" ).load( "ajax/test.html" );
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.