red-sky
Apr 25th 2009, 11:53 am
I am trying to insert the Javascript variable 'document.title' into a textarea i.e.
<textarea rows="3" cols="25"><a href="<?php echo selfURL(); ?>" title="<script>document.print(document.title);</script>">Link</a></textarea>
I also use PHP to grab the current pages URL (i.e. 'selfURL function') which removes the opportunity to print the entire line as a Javascript i.e.
<script>document.print("<textarea rows="3" cols="25"><a href="currenturl.html" title=""+document.title+"">Link</a></textarea>
I can grab the current URL with PHP and slot it into the links href no problem, its printing the global 'document.title' javascript variable into the links title attribute I can't do. Anyone know I could accomplish would I am trying to do?
Or maybe even provide a simpler solution?
Thanks in advance!
<textarea rows="3" cols="25"><a href="<?php echo selfURL(); ?>" title="<script>document.print(document.title);</script>">Link</a></textarea>
I also use PHP to grab the current pages URL (i.e. 'selfURL function') which removes the opportunity to print the entire line as a Javascript i.e.
<script>document.print("<textarea rows="3" cols="25"><a href="currenturl.html" title=""+document.title+"">Link</a></textarea>
I can grab the current URL with PHP and slot it into the links href no problem, its printing the global 'document.title' javascript variable into the links title attribute I can't do. Anyone know I could accomplish would I am trying to do?
Or maybe even provide a simpler solution?
Thanks in advance!