32 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
/* RSS Reading */
 | 
						|
function insertNewsSnippet(snippet,tag) {
 | 
						|
    /* DOM XML handling has been too problematic, so we are now using git-hooks to pre-generate the snippet. This function injects that snippet.
 | 
						|
     * param snippet: URI for the snippet
 | 
						|
     * param tag: div tag to overwrite
 | 
						|
     */
 | 
						|
    var http_request = false;
 | 
						|
    http_request = new XMLHttpRequest();
 | 
						|
    http_request.open("GET",snippet,true);
 | 
						|
    http_request.setRequestHeader("Cache-Control", "no-cache");
 | 
						|
    http_request.setRequestHeader("Pragma", "no-cache");
 | 
						|
    http_request.onreadystatechange = function() {
 | 
						|
        if (http_request.readyState == 4) {
 | 
						|
            if (http_request.status == 200) {
 | 
						|
                if (http_request.responseText != null) {
 | 
						|
                    document.getElementById(tag).innerHTML = http_request.responseText;
 | 
						|
                } else {
 | 
						|
                    alert("Failed to receive RSS file from the server - file not found.");
 | 
						|
                    return false;
 | 
						|
                }
 | 
						|
            }
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    http_request.send(null);
 | 
						|
}
 | 
						|
 | 
						|
/* Contact Obfuscation */
 | 
						|
function insertContactInfo() {
 | 
						|
    document.getElementById('contact-insert').innerHTML = '<b>Contact Us:</b><br/>Emai' + 'l: aninix' + '@' + 'proto' + 'n.me <br/>Phone: (60' + '8) 56' + '1-3607';
 | 
						|
}
 |