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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -