Jim from Oakland Posted July 3, 2006 Share Posted July 3, 2006 JavascriptersI'm not familiar enough with javascript to hack even this most basic need: I've got a php app and I hope to add help that is shown in a separate window when user clicks on a link (or button, if that helps). But, I want to send a string to the window as content, instead of specifiying a file (which I know how to do).Thanks a lot. Link to comment https://forums.phpfreaks.com/topic/13601-link-shows-window-window-content-sent-as-a-string/ Share on other sites More sharing options...
Gast Posted July 4, 2006 Share Posted July 4, 2006 Why not use a mixture of PHP and JavaScript?[code]<input type="button" onclick="window.open('help.php?content=whatever');" />/* On the help.php popup */<?phpif(isset($_GET['content'])) { switch($_GET['content']) { case "abc" : echo "page content"; include("relevant_file.html"); break; }}?>[/code] Link to comment https://forums.phpfreaks.com/topic/13601-link-shows-window-window-content-sent-as-a-string/#findComment-52848 Share on other sites More sharing options...
Jim from Oakland Posted July 4, 2006 Author Share Posted July 4, 2006 I hope to avoid the need for a file to"populate" the help window.I really want to open a new window (for help) and put the help content/message into the windowwhen a user clicks a link or if necessary a button.If I have to use a simple js function in <head> that isfine, buttons are ok too.pseudo(lameo)code<head><script language="javascript">function hlpWin($pContent=''){ var $Name = 'Help'; var hlpWin = window.open('',$Name,height=200,width=200); hlpWin.write($pContent);}</script></head><a onClick=hlpWin("<b>Help</b> for item 1 is on the way...")>Help 1</a> Link to comment https://forums.phpfreaks.com/topic/13601-link-shows-window-window-content-sent-as-a-string/#findComment-52973 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.