Search the Community
Showing results for tags 'ajax css'.
-
i want to reload parts of my page with the css intact. am using this code to load my css files but doesn't seem to work. if u could where is that am going wrong?? <script type="text/javascript"> $(document).ready(function(){ $.ajax({ url:"css/style.css", success:function(data){ $("<style></style>").appendTo("head").html(data); } }) }) function createObject() { var request_type; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ request_type = new ActiveXObject("Microsoft.XMLHTTP"); }else{ request_type = new XMLHttpRequest(); } return request_type; } var http = createObject() /* -------------------------- */ /* LOGIN */ /* -------------------------- */ /* Required: var nocache is a random number to add to request. This value solve an Internet Explorer cache issue */ var nocache = 0; function login() { // Optional: Show a waiting message in the layer with ID ajax_response document.getElementById('login_response').innerHTML = "Loading..." // Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding. var username= encodeURI(document.getElementById('username').value); var password = encodeURI(document.getElementById('password').value); // Set te random number to add to URL request nocache = Math.random(); // Pass the login variables like URL variable http.open('get', '/login.php?username='+username+'&password='+password+'&nocache = '+nocache); http.onreadystatechange = loginReply; http.send(null); } function loginReply() { if(http.readyState == 4){ var response = http.responseText; if(response == 0){ alert('Login failed! Verify user and password'); } else { alert('Welcome'+response); window.location='home.php'; } } } function forgot() { document.getElementById('login_blue_hdr').innerHTML = "done.." } </script> </head> thanks in advances