Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling size of "target: blank" command?

Status
Not open for further replies.

backspin

Technical User
Mar 13, 2002
40
0
0
US
If I have a link that opens a new browser window, is there a way to control the size? It defaults to opening a big new page. Any way to force it to be smaller?
 
you bet, post your code here for the opening window "Damn the torpedoes, full speed ahead!"

-Adm. James Farragut

Stuart
 
Hey schase, I know this is an old one but could you let me in on the secret. I have a go to detail behavior that I want to open up as a seperate window. But I want it to be smaller than opening the whole window.

Thanks

Brian
 
sure, takes a little bit o hand coding. but here ya go.


<a href=# onClick=MyWindow=window.open(my_detail_page.asp','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=420'); return false;>Click Here </a>


Now the above is regular code. you can see where you specify what you want.

if you want to add a asp component - just do something like this.


<a href=# onClick=MyWindow=window.open(my_detail_page.asp?ID=<%=recordset.fields.item(&quot;ID&quot;).value%>','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=420'); return false;>Click Here </a>
&quot;Never underestimate the power of determination&quot;

Stuart
 
schase thanks for the reply. Here is the code from the Go To Detail component that is in the page. I can not get it to work. What do you think?

<A HREF=&quot;description.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & &quot;CPNT_TITLE=&quot; & plateau.Fields.Item(&quot;CPNT_TITLE&quot;).Value %>&quot;>Detail</A>

Thanks
 
are you trying that by itself before doing the popup?

what error does it give you? &quot;Never underestimate the power of determination&quot;

Stuart
 
Yes it works fine before adding the pop up information. I get an error on about 7 lines asking if I want to debug. I am also not getting the URL parammeter to pass. It works fine thought before editing it.

Thanks

Brian
 
ok, couple things to try first.

First try this


<a href=# onClick=MyWindow=window.open(description.asp','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=420'); return false;>Click Here </a>

try that - it should give you an error, but we're testing first to see if the page loads ok.

and secondly, after you test the above, wipe it out and put this.


<A HREF=&quot;description.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & &quot;CPNT_TITLE=&quot; & plateau.Fields.Item(&quot;CPNT_TITLE&quot;).Value %>&quot;>Detail</A>

and test that.

If the first goes but the second does not than its a problem with the MM Code (no biggie to work around).

but test and let me know - oh write or cut/paste the error messages.


&quot;Never underestimate the power of determination&quot;

Stuart
 
This is the error I got when I ran the first line you suggested.

Line:264
Error: Expected ')'

The second line worked fine except that it opened in the same window and I had to use the back button to return to the main page.
 

<a href=# onClick=MyWindow=window.open('teststring2.asp','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=420'); return false;>Click Here</a>


try that &quot;Never underestimate the power of determination&quot;

Stuart
 
ok lets try to put it together.


<a href=# onClick=MyWindow=window.open('?<%= MM_keepURL & MM_joinChar(MM_keepURL) & &quot;CPNT_TITLE=&quot; & plateau.Fields.Item(&quot;CPNT_TITLE&quot;).Value %>','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=420'); return false;>Click Here</a>


Lemme know &quot;Never underestimate the power of determination&quot;

Stuart
 
Got this error again

Line:264
Error: Expected ')'

Also when I hover of the link I can usually see the URL parameter that is going to be passed in the bottom of the internet explorer. Now I see /azlist.asp?offset=0#

Thanks

Brian
 
ok, wipe out above and try this



<% response.write &quot;<a href=# onClick=MyWindow=window.open('description.asp?CPNT_TITLE='&quot; & plateau.Fields.Item(&quot;CPNT_TITLE&quot;).Value & &quot;','MyWindow','toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=420'); return false;>Click Here</a> &quot;%>

&quot;Never underestimate the power of determination&quot;

Stuart
 
Still getting the error: Expected')'

<!--
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
} This is line 264. It throws the error for like 7 or 8 lines that have the }as the last item in the script.

I am may just rethink how I want to display the data. I did not think this would be that dificult. I really appreciate the help.

Thanks

Brian
 
Well the code seems to work stand alone on my test here.

still have my email address?

Send it on over. I'm thinking its just MM code gone wacky. &quot;Never underestimate the power of determination&quot;

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top