37 users online (0 members and 37 guests)  


  Results 1 to 5 of 5

Related

  1. Onclick Listbox    Forum: Javascript Forum
    Replies: 2
  2. onClick problem    Forum: Javascript Forum
    Replies: 1
  3. onclick help    Forum: Javascript Forum
    Replies: 3
  4. onClick on php?    Forum: PHP Forum
    Replies: 1
  5. javascript onclick event to refresh iframe.    Forum: Javascript Forum
    Replies: 5
  1. #1
    Glenvern's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Apr 2002
    Location
    Norfolk, UK.
    Posts
    112

    onClick and <iframe>

    I would like to onclick to an <iframe> from inside a <td> cell...

    <td>onclick="<iframe width=200 height=200 src="popup.htm" scrolling=no>Click here</td>

    This will not work - but does anyone know the correct syntax to make it work.?

    thanx...
    Glenvern

  2. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: onClick and <iframe>

    I can get you the correct syntax, but first, are you wanting to display the iframe in a new page, in a specific location on the current page, or as a popup?

  3. #3
    Glenvern's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Apr 2002
    Location
    Norfolk, UK.
    Posts
    112

    Re: onClick and <iframe>

    Ideally I would like it as a popup on the same page, where it can be placed anywhere I choose using "position absolute"..

    thanx..
    Glenvern

  4. #4
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: onClick and <iframe>

    Try this in the head:
    HTML Code:
    <script language="javascript" type="text/javascript">
    <!--
    function popupwin(url) {
    	newwindow=window.open(url,'name','height=200,width=200');
    	if (window.focus) {newwindow.focus()}
    	return false;
    }
    
    // -->
    </script>
    And this in the body:
    HTML Code:
    <a href="popupex.html" onclick="return popupwin('popup.htm')">Click here</a>
    Let me know if it does what you need it to.

  5. #5
    Glenvern's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Apr 2002
    Location
    Norfolk, UK.
    Posts
    112

    Re: onClick and <iframe>

    Thanx for that - I am already using that as I can't get the iframe to work with onclick...

    (Iframe presents a much nicer looking window)
    Glenvern



Tags for this Thread