-
-
Save wemakeweb/8184688 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
$(function) ist Kurzform für | |
document ready | |
*/ | |
$(function() { | |
// alle vars die jQuery objecte enthalten mit $ prefixen | |
var $home = $("#index"), | |
$vors = $("#vorstellung"), | |
$vorb = $("#vorbereitung"), | |
$aneig = $("#aneignung"), | |
$nachb = ("#nachbereitung"), | |
$esem = $("#eseminar"), | |
$webk = $("#webkonferenz"); | |
$vors.on('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(xhr, status, error) { | |
alert(status); | |
alert(error); | |
$("#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').on('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