javascript - Updating <div> text with value from the previous page -
i'm redirecting user page when click "edit" button using code below.
$('#editlistbutton').click(function(){ window.location.href = "http://localhost/yyy.php"; //redirect // changes need made $('#defaulttext').remove(); $('#orderlist').append('<p' + 'message' + '</p>'); });
the page redirects predefined link, after need update html <div>
tag text. code coming other page nothing. how can change text in div tag?
there many ways pass information 1 page another. give idea of concept, in relation question posted, here's one:
page a:
$('#editlistbutton').click(function(){ window.location.href = "http://localhost/yyy.php?action=remove&value=" + encodeuricomponent('ashdahjsgfgasfas'); });
page b:
var action = /(?:\?|&)action=([^&$]+)/.exec(location.search) if ( 'remove' === action[1] ) { var value = /(?:\?|&)value=([^&$]+)/.exec(location.search) $('#defaulttext').remove(); $('#orderlist').append('<p>' + value[1] + '</p>'); }
Comments
Post a Comment