Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 2nd, 2006, 06:36 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default Add a parameter to a pop up window

Hallo everyone,

I am now trying to make a pop up window from a link which also has to take a parameter from the homepage in order to use this parameter in another javascript of that pop up window. How can I do it?



Your attitude determines your altitude
__________________
Your attitude determines your altitude
 
Old August 2nd, 2006, 06:45 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You have at least two choices:
* If the paarmeter is serialisable include it as a querystring
* If it's an object pass it using the reference returned by window.open:
Code:
var oChildWindow = window.open(sUrl, sName, sFeatures);
oChildWindow.data = <your parameter here>;
Then in the popup you can access self.data.


--

Joe (Microsoft MVP - XML)
 
Old August 2nd, 2006, 06:58 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hallo Joe,

I have an object which accesses to article IDs from SOAP. When I click a headline I want to open a pop up browser which grabs this object and writes the article to this pop up browser.

Your attitude determines your altitude
 
Old August 2nd, 2006, 08:42 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is the code:

for(var i=0; i<size;i++){
        var article;
        myArray6[i] = xmldoc.selectNodes("//fcs:folder/fcs:folderHeadlinesResultSet/fcs:folderHeadline/fcs:contentParts/fcs:part/@type")[i];
        if (myArray6[i].value=="NewsArticle") {
          article = xmldoc.selectNodes("//fcs:folder/fcs:folderHeadlinesResultSet/fcs:folderHeadline/fcs:contentParts/fcs:part/@reference")[i].value;
          alert(article);
        }
        myArray1[i] = xmldoc.selectNodes("//fcs:folder/fcs:folderHeadlinesResultSet/fcs:folderHeadline/fcs:baseLanguage")[i];
        myArray2[i] = xmldoc.selectNodes("//fcs:folder/fcs:folderHeadlinesResultSet/fcs:folderHeadline/fcs:wordCount")[i];
        myArray3[i] = xmldoc.selectNodes("//fcs:folder/fcs:folderHeadlinesResultSet/fcs:folderHeadline/fcs:publicationDate")[i];
        myArray4[i] = xmldoc.selectNodes("//fcs:folder/fcs:folderHeadlinesResultSet/fcs:folderHeadline/fcs:publicationTime")[i];
        myArray5[i] = xmldoc.selectNodes("//fcs:folder/fcs:folderHeadlinesResultSet/fcs:folderHeadline/fcs:headline/fcs:paragraph")[i];
        row = myTable.insertRow(i+1);
        myCell=row.insertCell(0);
        myCell.innerText = myArray1[i].text;
        myCell2 = row.insertCell(1);
        myCell2.innerText = myArray2[i].text;
        myCell3 =row.insertCell(2);
        myCell3.innerHTML ="<a href ='javascript: popUp(article); '>"+ myArray5[i].text+"</a>";
        myCell4 = row.insertCell(3);
        myCell4.innerText = myArray3[i].text;

      }

I hope you could understand what I meant. It doesn't work. It says article is undefined but I have to parse this article to a new pop up window.

Your attitude determines your altitude





Similar Threads
Thread Thread Starter Forum Replies Last Post
Window refresh and window pop up in Java Script Aleksandra Javascript How-To 2 March 2nd, 2007 06:47 PM
Pop Window testsubject General .NET 1 July 2nd, 2006 01:29 PM
pop up window sankar VB How-To 0 July 29th, 2003 01:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.