Skip to content

Instantly share code, notes, and snippets.

Created December 30, 2013 16:55
Show Gist options
  • Save anonymous/8184675 to your computer and use it in GitHub Desktop.
Save anonymous/8184675 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
var home = $("#index");
var vors = $("#vorstellung");
var vorb = $("#vorbereitung");
var aneig = $("#aneignung");
var nachb = ("#nachbereitung");
var esem = $("#eseminar");
var webk = $("#webkonferenz");
vors.click(function() {
var href = "vorstellung";
getContent(href);
//testFunktion(href);
});
//getContent --- URL aufrufen
function getContent(href) {
$.ajax({
type : "POST",
url : href + ".html",
dataType : "html",
beforeSend : function(xhr) {
xhr.overrideMimeType("text/html; charset=ISO-8859-1");
},
success : parseHTML,
error : function() {
$("#content").html(href);
//$('#content').html("<h3 style='text-align: center;'>Es ist ein Fehler aufgetreten</h3>");
}
});
}
function parseHTML(html) {
//alert("JAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
content = $(html).filter("#content").text();
$("#content").html(content);
}
function testFunktion(href) {
alert(href);
}
// SIDEBAR
$('#simple-menu').sidr();
//ACTIVE
$('#sidr ul li a').click(function() {
$('#sidr ul li a').removeClass("active");
$(this).addClass("active");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment