function getUrlVars() { let vars = [], hash; let href = window.location.href; let start = href.indexOf('?'); let end = href.indexOf('#'); if(end < 0) { end = href.length; } console.log(end); var hashes = href.slice(start + 1, end).split('&'); for(let i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } let query_string = getUrlVars(); let hash_string = window.location.hash; console.log(query_string); console.log(hash_string); let search = ""; if(query_string["contact"] != "" && query_string["contact"] != undefined) { search = query_string["contact"]; } if("contact" in query_string) { document.getElementById('contact').scrollIntoView(true); } $(document).ready(function() { $('#contact-table').DataTable( { "order": [[0, "asc"]], "paging": false, "ordering": false, "info": false, "search": { "search": search }, "language": { "decimal": "", "emptyTable": "Gibt nix zu zeigen", "info": "Zeige _START_ bis _END_ von _TOTAL_ Einträgen", "infoEmpty": "Zeige 0 bis 0 von 0 Einträgen", "infoFiltered": "(aus _MAX_ Einträgen)", "infoPostFix": "", "thousands": ",", "lengthMenu": "Zeige _MENU_ Einträge", "loadingRecords": "", "processing": "", "search": "Durchsuchen:", "zeroRecords": "Nix gefunden", "paginate": { "first": "", "last": "", "next": "", "previous": "" }, "aria": { "sortAscending": ": activate to sort column ascending", "sortDescending": ": activate to sort column descending" } } } ); } ); /* ghost.init({ clientId: "ghost-frontend", clientSecret: "4e0fe17f9abc" }); function printPosts(data) { let $result = $('#posts'); $.each(data.posts, function (i, post) { $result.append( '