Results 1 to 3 of 3

Thread: pop up title

  1. #1
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default pop up title

    im trying to give titles to my pop up without success using this ... any suggestions??

    button:
    Code:
    <a href="javascript:PopUp_1()">item 1</a>
    js for pop up
    Code:
    function PopUp_1(){
    	globalHTML="<html><head><title>Something Different</title></head>"+"<frameset rows='100%,*'><frame src='"+"http://www.skidmore.edu/~hfoley/sounds/PR3s.wav"+"'></frame>"+"</frameset></html>";
    window.open("javascript:opener.globalHTML","myPOPUP", features);
    }

  2. #2
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    118
    Thanks
    16
    Thanked 1 Time in 1 Post

    Default

    Not sure why you would need to create a framed window within a new web page, which is essentially what a pop up window is.

    I would push all the code you used in JavaScript in a new web page for the pop up.

    Code:
    <html>
    <head>
    <title>Something Different</title>
    </head>
    <frameset rows='100%'>
    <frame src='http://www.skidmore.edu/~hfoley/sounds/PR3s.wav'>
    </frame>
    </frameset>
    </html>
    and still use the same code to call the web page.

    Code:
    function PopUp_1() {
    window.open( "newpage.html" )
    I've never heard of a case where JavaScript can dynamically create a new web page other than the session you are on, so that method would not be feasible. I could be wrong.

    However, on the new page, you could pass a variable to the popup window (the page title for example) and then use DOM to manipulate the Title's Attribute.

  3. #3
    Join Date
    Jan 2008
    Posts
    441
    Thanks
    67
    Thanked 4 Times in 4 Posts

    Default

    weird, this was working last night but now its not
    Code:
    <HTML>
    <head>
    <script>
    var objTimer1, newOpenWindow1;
    var features = 'width=400,height=250,toolbar=0,location=0,status=1,menuBar=0,scrollBars=0,resizable=0';
    
    function PopUp_1(){
    	var myWindowName = 'name - 1';
    	var whichPage = 'someContent.html';
    	newOpenWindow1 = window.open(whichPage,myWindowName,features);
    	objTimer1 = window.setInterval("docFunc1('name - 1')", 10);
    }
    function docFunc1(newTitle1){ 
    	if (newOpenWindow1.document.readyState == 'complete'){ 
    		newOpenWindow1.document.title=newTitle1;
    		window.clearInterval(objTimer1);
    	}
    }
    </script>
    </head>
    <body>
    <input type=button value="open window" onclick="PopUp_1()"></input>
    </body>
    </HTML>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •