Skip to content

Instantly share code, notes, and snippets.

@sivaprabug
Created February 24, 2016 11:03
Show Gist options
  • Select an option

  • Save sivaprabug/feaaed6cd585976d637d to your computer and use it in GitHub Desktop.

Select an option

Save sivaprabug/feaaed6cd585976d637d to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>jQuery Test page</title>
<script type="text/javascript" src="libs/jQuery/jquery-2.1.0.js"></script>
<script>
if (typeof jQuery != 'undefined') {
console.log(jQuery.fn.jquery);
}
</script>
<style>
</style>
</head>
<body>
<label class="logo">
SERVER
</label>
</body>
<script>
$(document).ready(function() {
sessionStorage.setItem('masterSlaveStatus', 'Master');
sessionStorage.setItem('masterSlaveStatus', 'Slave');
status = sessionStorage.getItem("masterSlaveStatus")
if (status == 'Master') {
console.log('Master');
$('label.logo').text('SERVER (M)');
} else {
console.log('Slave');
$('label.logo').text('SERVER (S)');
}
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment