function getQuery() { var search = window.location.search; var query = {}; if (search) { var str = search.substr(1); if (str.indexOf('&') >= 0) { var parts = str.split('&'); for (var i = 0; i < parts.length; i++) { var pair = parts[i].split('='); query[pair[0]] = pair[1]; } } else { var pair = str.split('='); query[pair[0]]= pair[1]; } return query; } else { return null; } }
key = getQuery().postid ; from= getQuery().update; alert("postid : " + postid + ',update: ' + fromupdate' );