Without elaboration plz see my code: <body> <script> var b="s"; </script> <button target="_blank" onclick="window.open('http://......php?b="javascript:document.write(b);"&id=2&q=<?php print $_GET['q']; ?>','1','');return false;">xyz</button> </body> Code (markup): i don understand why this javascript:document.write(b); doesnt work in url... i know its simple yet it make my hair out of my head. plz count it..
You have a big conceptual error here. You are messing things up. <script> var url = 'http://......php?id=2&q=<?php print $_GET['q']; ?>&b='; </script> <button target="_blank" onclick="window.open(url + b, '1', ''); return false;">xyz</button> Code (markup):