I am trying to update a div on a page with the name of the server on which the page is displayed. This is just for the test, so we can check what happens when the cookie’s battery life expires. I want to do this with jquery, but I can't get anything to work. I found an online example that I worked on, but keep getting errors.
We have an html page on each of our servers that simply contains the server name. This is the text from this page that we want to display in the div.
Below is the code I found. Can anybody help me? I am new to jquery. Any help would be greatly appreciated.
Thank,
`
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.ui/1.8.5/jquery-ui.min.js"></script>
<script src="../Scripts/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="../Scripts/jquery.timers-1.0.0.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
var j = jQuery.noConflict();
j(document).ready(function () {
j(".refreshMe").everyTime(5000, function (i) {
j.ajax({
url: "refresh.html",
cache: false,
success: function (html) {
j(".refreshMe").html(html);
}
})
})
});
j('.refreshMe').css({ color: "red" });
});
</script>
`
source
share