Question
I have two webpages I want the Messages that appeas when the button is pressed to be displayed on the other page and vic versa.
I have two webpages I want the Messages that appeas when the button is pressed to be displayed on the other page and vic versa.
for example. on page one if "place order" is click then that message should show on page two.
page one code
KMOG U.I.
var x = document.getElementById("ui");
function ChangState() {
x.innerHTML = "Your Order has been Placed";
clear();//call function clear()
}
//function confirm1()
function confirm1()
{
//showing alert to the user
var usrResponse=confirm('are you sure you want to cancle the order?');
if(usrResponse==true)
{
//when user response is true then
ChangState2();//call function ChangState2()
}
}
//function ChangState2()
function ChangState2() {
x.innerHTML = "Your Order has been canceled";
clear();//call function clear()
}
//function confirm2()
function confirm2()
{
//showing alert to the user
var usrResponse=confirm('The sterilization is not done. Do you still want to unlock the book?');
if(usrResponse==true)
{
//when user response is true then
ChangState3();//call function ChangState3()
}
}
function ChangState3() {
x.innerHTML = "The UV book is now unlocked";
clear();//call function clear()
}
//function to clear message
function clear()
{
setTimeout( function(){x.innerHTML="";}, 5000);
return false;
}
page two code
KMOG U.I.
var x = document.getElementById("ui"); function ChangState() {
x.innerHTML = "Message: A driver has picked up your order and is on rout to your location has been sent to user"; clear();//call function clear()
}
//function confirm1()
function confirm1()
{ x.innerHTML ="Message: UV box is not done has been sent to user"; clear();
}
//function confirm2()
function confirm2()
{
x.innerHTML ="A driver has picked up your order and is on rout to your location"; clear(); }
//function to clear message
function clear()
{
setTimeout( function(){x.innerHTML="";}, 5000);
return false;
}
can't i use cookies or session to do this? or Xamp?
cuz in Amazon for example if I have two pages open and I hit add to cart in one page it shows up on the other.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started