0
我想找到一種方法來加載一個特定的iframe取決於是否有一個更長的路徑名提供,我需要一個,如果路徑名是正常加載(即不' t在最後有額外的搜索),然後加載另一個iframe,如果搜索等於我有一個特定的網址,到目前爲止我已經提出了以下,但我不確定下一步怎麼去/如何加載特定的iframe?任何幫助感謝!如果路徑名包含....加載特定的iframe
$(document).ready(function(){
var pathname = window.location.pathname;
if(pathname.indexOf('#this needs to be empty?') > -1){
>>>>>load first iframe
}
});
$(document).ready(function(){
var pathname = window.location.pathname;
if(pathname.indexOf('?thisismysearchpath') > -1){
>>>>load second iframe
}
});
有什麼問題你的榜樣?錯誤? – bjb568