Solved

Change window size on Pop up script

Posted on 1998-02-12
4
186 Views
Last Modified: 2012-05-04
Hello.

My left frame lauches on mouseover a pop up window containing a multisearch script. When the selection is made the script lauches a new window containing the result of the search. The size of this window is the same as the pop up window. I need this result window to be full size. And the opo up window to disappear when the search is submitted.

Here is the Url

http://www.secretplace.com/test/search/

Here is the multisearch script also:


<SCRIPT LANGUAGE="JavaScript">
<!-- Hide this script from old browsers --
Yahoo = "http://search.yahoo.com/bin/search?p=";
Alta = "http://www.altavista.digital.com/cgi-bin/query?pg=q&what=web&q=";
Open = "http://search.opentext.com/omw/simplesearch?SearchFor=";
Lycos = "http://www.lycos.com/cgi-bin/pursuit?query=";
Crawler = "http://www.webcrawler.com/cgi-bin/WebQuery?searchText=";
InfoSeek = "http://guide-p.infoseek.com/Titles?qt=";
DejaNews = "http://search.dejanews.com/nph-dnquery.xp?query=";
Inktomi = "http://204.161.74.8:1234/query/?query=";
MetaCrawler = "http://metacrawler.cs.washington.edu:8080/htbin-post/nph-metaquery.p?general=";
SavySearch = "http://guaraldi.cs.colostate.edu:2000/search?KW=";
Excite = "http://www.excite.com/search.gw?searchType=Concept&search=";
Magellan = "http://www.mckinley.com/searcher.cgi?query=";
Point = "http://point.lycos.com/cgi-bin/pursuit?query=";
Galaxy = "http://www.einet.net/cgi-bin/wais-text-multi?keywords=";
var got=0;
var url = "";
var plus="";
var mag="";
function search4(item){
        stringPlus();
        resultsWindow=window.open();
        resultsWindow.document.open();
        resultsWindow.document.write("<head><title>Close this window to return to Total Search</title></head>");
  resultsWindow.document.write("<FRAMESET ROWS=50%,50%><FRAMESET COLS=50%,50%><FRAME NAME='frame0' SRC='" + computeFrameSrc(0) + "'><FRAME NAME='frame1' SRC='" + computeFrameSrc(1) + "'></FRAMESET>");
        resultsWindow.document.write("<FRAMESET COLS=50%,50%><FRAME NAME='frame2' SRC='" + computeFrameSrc(2) + "'><FRAME NAME='frame3' SRC='" + computeFrameSrc(3) + "'></FRAMESET></FRAMESET>");
        resultsWindow.document.close();
        got = 0;
}
function search2(item){
        stringPlus();
        resultsWindow=window.open();
        resultsWindow.document.open();
        resultsWindow.document.write("<head><title>Close this window to return to Total Search</title></head>");
  resultsWindow.document.write("<FRAMESET ROWS=50%,50%><FRAME NAME='frame0' SRC='" + computeFrameSrc(0) + "'><FRAME NAME='frame1' SRC='" + computeFrameSrc(1) + "'></FRAMESET>");
        resultsWindow.document.close();
        got = 0;
}
function stringPlus(){
        for (var j=0; j < window.document.choose4.text.value.length; j++){
                if (window.document.choose4.text.value.charAt(j) == " ")
                        mag += "+";
                else
                        mag += window.document.choose4.text.value.charAt(j);}
}
function numChecked(item){
        plus = escape(item.text.value);
        var h=0;
        num=0;
        for (var l=0; l < item.check1.length; l++) {
                if (item.check1[l].checked){
                                h++;
                        if (h++ <= 4){
                                if (l == "0"){
                                         num = 1;}
                                else if (l == "1"){
                                        num = 2;}
                                else if (l == "2"){
                                        num = 3;}
                                else if (l == "3"){
                                        num = 4;}
                                else if (l == "4"){
                                        num = 5;}
                                else if (l == "5"){
                                        num = 6;}
                                else if (l == "6"){
                                        num = 7;}
                                else if (l == "7"){
                                        num = 8;}
                                else if (l == "8"){
                                        num = 9;}
                                else if (l == "9"){
                                        num = 10;}
                                else if (l == "10"){
                                        num = 11;}
                                else if (l == "11"){
                                        num = 12;}
                                else if (l == "12"){
                                        num = 13;}
                                }
                }
        }
        if (h == 2)
                Results(num-1);
        else if (h == 4)
                search2(item);
        else
                search4(item);
}
function computeFrameSrc(num){
        var k=-1;
        for (var j=got; j < document.choose4.check1.length; j++) {
                if (document.choose4.check1[j].checked){
                                k++;
                        if (k++ <= num){
                                if (j == "0"){
                                        url = Yahoo + plus;
                                        got = 1;}
                                else if (j == "1"){
                                        url = Magellan + mag;
                                        got = 2;}
                                else if (j == "2"){
                                        url = Point + plus;
                                        got = 3;}
                                else if (j == "3"){
                                        url = Alta + plus + "&mode=and";
                                        got = 4;}
                                else if (j == "4"){
                                        url = Open + plus + "&mode=and";
                                        got = 5;}
                                else if (j == "5"){
                                        url = Lycos + plus + "&backlink=217&maxhits=25";
                                        got = 6;}
                                else if (j == "6"){
                                        url = Excite + plus + "&category=default&mode=relevance&showqbe=1&display=html3,hb";
                                        got = 7;}
                                else if (j == "7"){
                                        url = Crawler + plus + "&maxHits=25";
                                        got = 8;}
                                else if (j == "8"){
                                        url = InfoSeek + plus + "&col=WW";
                                        got = 9;}
                                else if (j == "9"){
                                        url = DejaNews + plus + "&defaultOp=AND&svcclass=dncurrent&maxhits=25";
                                        got = 10;}
                                else if (j == "10"){
                                        url = Inktomi + plus + "&hits=25&disp=Text+Only";
                                        got = 11;}
                                else if (j == "11"){
                                        url = MetaCrawler + plus + "&logic=0®ion=The+World&orgType=Any&maxwait=1&score=0";
                                        got = 12;}
                                else if (j == "12"){
                                        url = SavySearch + plus + "&classic=on&t1=x&Boolean=AND&Hits=10&Mode=MakePlan&df=normal&AutoStep=on&AutoInt=on&lb=1";
                                        got = 13;}
                                return url;
                                }
                }
        }
        url = "http://www.personalcompass.com/empty.html";
        return url;
}
function Results(place){
        stringPlus();
        resultsWin = open("","results");
        if (place == "0")
                url = Yahoo + plus;
        else if (place == "1")
                url = Magellan + mag;
        else if (place == "2")
                url = Point + plus;
        else if (place == "3")
                url = Alta + plus + "&mode=and";
        else if (place == "4")
                url = Open + plus + "&mode=and";
        else if (place == "5")
                url = Lycos + plus + "&backlink=217&maxhits=25";
        else if (place == "6")
                url = Excite + plus + "&category=default&mode=relevance&showqbe=1&display=html3,hb";
        else if (place == "7")
                url = Crawler + plus + "&maxHits=25";
        else if (place == "8")
                url = InfoSeek + plus + "&col=WW";
        else if (place == "9")
                url = DejaNews + plus + "&defaultOp=AND&svcclass=dncurrent&maxhits=25";
        else if (place == "10")
                url = Inktomi + plus + "&hits=25&disp=Text+Only";
        else if (place == "11")
                url = MetaCrawler + plus + "&logic=0®ion=The+World&orgType=Any&maxwait=1&score=0";
        else if (place == "12")
                url = SavySearch + plus + "&classic=on&t1=x&Boolean=AND&Hits=10&Mode=MakePlan&df=normal&AutoStep=on&AutoInt=on&lb=1";
      resultsWin.location = url;
}
// -- End Hiding Here -->
</SCRIPT>

I give all my left points. Thank you
 
0
Comment
Question by:samui
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
Christian_Wenz earned 70 total points
ID: 1278223
unfortuneetatelzy,  if you want a new window to be full size, open it using JS and give it width and height of, let's say, 2000 pixels. It will now be on maximum etxtent.

If you want to resize an _existing_ window, you will have to use Netscape Navigator 4+, sorry.
0
 

Author Comment

by:samui
ID: 1278224
Could you tell me where this line will appear in the script.
I am not very good in manipulating window.open function.

Thank you.
0
 
LVL 5

Expert Comment

by:Christian_Wenz
ID: 1278225
several times, you have a line that looks like this:

  resultsWin = window.open();

or

  resultWin = window.open("", "results");

try changing this to
  resultWin = window.open("", "results", "width=2000,height=2000");

wherever you want a full-screen window to appear.

Please leave me a comment if you have additional questions.
0
 

Author Comment

by:samui
ID: 1278226
Thank you very much. It works fine.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now