Jump to content

New window


Guest old-celt

Recommended Posts

Guest old-celt

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

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

<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>

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

  • 3 months later...
Guest Webcoyote1245
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.

Use the following code <A href="samplepage.htm" target"=_new">your line words or graphic here</a>
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...