Using JavaScript, how can i open a new window (loading, say, http://www.google.com in the process) and inject/insert this code into its body:
<script type="text/javascript">alert(document.title);</script>
I know how to open a new window, but i don't know how to add the script to the new window and run it:
var ww = window.open('http://www.google.com');