2014-01-18 30 views
0

嗨我試圖改變我這樣的內容:

$("ul#nav li a").click(function(){ 
    var href = $(this).attr("id"); //getID in a String 

    getContent(href); 

    $("ul#nav li a").removeClass("active"); //Active 
    var select = $("#" + href); 
    select.addClass("active"); 
}); 

//getContent --- URL aufrufen 
function getContent(href) { 
    $.ajax({ 
     type : "GET", 
     //url: href + ".html", 
     //url : "http://localhost/ProVid/" + href + ".html", 
     url: "http://webuser.hs-furtwangen.de/~lieneman/pages/" + href + ".html", 
     //url: "http://webuser.hs-furtwangen.de/~lieneman/pages/vorstellung.html", 
     dataType : "html", 

     beforeSend : function(xhr) { 
      xhr.overrideMimeType("text/html; charset=ISO-8859-1"); 
     }, 
     success : parseHTML, 
     error : function(xhr, ajaxOptions, thrownError) { 
      alert(xhr.status); 
      $('#content').html("<h3 style='text-align: center;'>Es ist ein Fehler aufgetreten</h3>"); 
     } 
    }); 
} 

function parseHTML(html) { 
    content = $(html).filter("#content").text(); 
    titel = $(html).filter("#title").text(); 
    video = $(html).filter("#video").text(); 

    $("#content").html(content); 
    $("#title").html(titel); 
    $("#video").html(video); 
} 

它僅工作了正常的HTML內容。但我想加載一個vimeo視頻(iFrame)。

明鏡Nachbereitungs-Baustein

回答

2

檢查您的控制檯,你看到的線沿線的東西:

拒絕在該框架中顯示 'http://vimeo.com'因爲它將'X-Frame-Options'設置爲'SAMEORIGIN'。

的Vimeo都在積極努力,以防止在iframe中顯示自己的網站加入這個頭的所有響應https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options

編輯: 我看到他們的標準嵌入代碼使用iframe,爲他們顯然不適用這個限制,所以如果這是你正在使用的,那麼這不會是你的問題的原因。