Guest old-celt Posted January 25, 2006 Share Posted January 25, 2006 I'm trying to learn HTML/XHTML and I'd like to be able to pop up a window containing a small amount of data without leaving the existing page. I've seen this on many web sites but I can't see how it's done from the training pages in W3Schools. The small window normally has just a single button at the end of the data which is 'Close Window'.Sorry if this is a FAQ but I've searched the forum without finding what I'm looking for.TIA. Link to comment Share on other sites More sharing options...
smiles Posted January 25, 2006 Share Posted January 25, 2006 I'd like to be able to pop up a window containing a small amount of data without leaving the existing page ... you can use Javascript : http://www.w3schools.com/js/tryit.asp?file...ryjs_openwindowyou can write data in this window if you want<HEAD> <script LANGUAGE="JavaScript"> function displayHTML(form) { var inf = form.htmlArea.value; win = window.open(", ", 'popup', 'toolbar = no, status = no'); win.document.write("" + inf + ""); } </script> </HEAD> <form> <textarea name="htmlArea" cols=45 rows=6> </textarea> <br> <input type="button" value=" view " onclick="displayHTML(this.form)"> </form> Link to comment Share on other sites More sharing options...
DarkElf Posted January 25, 2006 Share Posted January 25, 2006 If all you want is to display text then try using the javascript alert function. See http://www.w3schools.com/js/js_popup.aspIf you want to actually open another page with the information on it then just set the hyperlink to open in a new window using the target attribute: <a href="url" target="_blank">hyperlink-name</a> Link to comment Share on other sites More sharing options...
scott100 Posted January 25, 2006 Share Posted January 25, 2006 <HEAD> <script LANGUAGE="JavaScript"> function displayHTML(form) { var inf = form.htmlArea.value; win = window.open(", ", 'popup', 'toolbar = no, status = no'); win.document.write("" + inf + ""); } </script> </HEAD> <form> <textarea name="htmlArea" cols=45 rows=6> </textarea> <br> <input type="button" value=" view " onclick="displayHTML(this.form)"> </form> <{POST_SNAPBACK}> Right idea but it seems a bit complicated, you can do this with one line of code:<input type="button" onclick="window.open('http://www.google.com',null,'height=200,width=400,status=yes,toolbar=no,menubar=no,location=no');" value="click me" /> Link to comment Share on other sites More sharing options...
smiles Posted January 25, 2006 Share Posted January 25, 2006 yes , maybe I am thinking so much about my chat program , your data may be an url Link to comment Share on other sites More sharing options...
Guest Webcoyote1245 Posted May 4, 2006 Share Posted May 4, 2006 I'm trying to learn HTML/XHTML and I'd like to be able to pop up a window containing a small amount of data without leaving the existing page. I've seen this on many web sites but I can't see how it's done from the training pages in W3Schools. The small window normally has just a single button at the end of the data which is 'Close Window'.Sorry if this is a FAQ but I've searched the forum without finding what I'm looking for.TIA.<{POST_SNAPBACK}> Use the following code <A href="samplepage.htm" target"=_new">your line words or graphic here</a> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now