Ciao ho creato un messaggio in javascript mettendo la funzione di ricarica della pagina questo è lo script:
Codice PHP:
<html xmlns="http://www.w3.org/1999/xhtml" lang="it">
<head>
<meta name="Keywords" content="javascript" />
<script src="jquery-1.4.1.js" type="text/javascript"></script>
<!-- <script src="jquery.msgBox.min.js" type="text/javascript"></script>-->
<script src="jquery.msgBox.js" type="text/javascript"></script>
<link href="msgBoxLight.css" rel="stylesheet" type="text/css" />
<link href="styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(function () {
$(window).scroll(function () {
var top = $(window).scrollTop();
$("div.social").css({ position: (top > 260 ? "fixed" : "absolute"), top: top > 260 ? 10 : 260 });
});
});
</script>
<script type="text/javascript">
function setCodeView(mainCode) {
var code = mainCode.split('');
var temp = "";
var spanRed = "<span style=\"color:red;\">";
var spanGreen = "<span style=\"color:green;\">";
var spanClose = "</span>";
var isOpen = false;
var lastIndex = 0;
for (var i = 0; i < code.length; i++) {
if (code[i] == '"' || code[i] == ''') {
temp += (isOpen ? code[i] + spanClose : spanRed + code[i]);
lastIndex = i;
isOpen = !isOpen;
}
else if (code[i] == ',' || code[i] == ':' || code[i] == '{' || code[i] == '}') {
temp += spanGreen + code[i] + spanClose;
}
else if (code[i] == '<') {
temp += "<";
}
else if (code[i] == '>') {
temp += ">";
}
else if (code[i] == '\n') {
temp += i == 0 ? "" : (i == code.length - 1 ? "" : "<br/>");
}
else if (code[i] == ' ') {
temp += ' ';
}
else {
temp += code[i];
}
}
return temp;
}
function SetCodeBlocks() {
$("div.codeBlock>code").each(function (index, domEle) {
var code = setCodeView($(this).html());
$(this).html(code);
});
}
$(function () {
SetCodeBlocks();
});
</script>
<script type="text/javascript">
function example4() {
$.msgBox({
title: "Ooops.. Sito in manutenzione",
content: "Ci scusiamo per gli eventuali errori, il nostro è momentaneamente OFF..<br /> A causa di aggiornamenti <br /> <div class='buttonBlock'><p><input type='button' onclick='refresh()' value='Ricarica Pagina'name='button1'></p></div>",
type: "error",
});
}
function example7() {
$.msgBox({ type: "prompt",
title: "Log In",
inputs: [
{ header: "User Name", type: "text", name: "userName" },
{ header: "Password", type: "password", name: "password" },
{ header: "Remember me", type: "checkbox", name: "rememberMe", value: "theValue"}],
buttons: [
{ value: "Login" }, { value: "Cancel"}],
success: function (result, values) {
var v = result + " has been clicked\n";
$(values).each(function (index, input) {
v += input.name + " : " + input.value +
(input.checked != null ? (" - checked: " + input.checked) : "") + "\n";
});
alert(v);
}
});
}
</script>
</head>
<body>
<!--Example 4-->
<div class="buttonBlock">
<input type="button" value="Example 4" onClick="example4();"/>
</div>
<!--Example 4 End-->
</body>
</html>
<!-- 2 -->
<html>
<head>
<script language="JavaScript">
<!--
// The "refresh" function implementations are identical
// to our regular "JavaScript-Refresh" example. The only
// difference from our JavaScript Refresh example is
// we do not have a doLoad function that starts our
// refresh timer (since we use a refresh button).
var sURL = unescape(window.location.pathname);
function refresh()
{
window.location.href = sURL;
}
//-->
</script>
<script language="JavaScript1.1">
<!--
function refresh()
{
window.location.replace( sURL );
}
//-->
</script>
<script language="JavaScript1.2">
<!--
function refresh()
{
window.location.reload( false );
}
//-->
</script>
</head>
<body>
</body>
</html>
Lo voglio aprire senza un bottone cioè al caricamento della pagina solo che questo messaggio si apre con il bottone o provato ad inserire un alert ma non lo da, lo ho provate con tutte cosa posso fare?
Aiutatemi..