|
-
Sep 28th, 2001, 02:21 AM
#1
Thread Starter
PowerPoster
How to open a URL in a new window?
How can I use server-side scripts to open a URL in a new browser window, like a little popup ad?
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Sep 28th, 2001, 06:03 AM
#2
Black Cat
I pretty sure those are all done with client side javascript. Caused a lot of people to turn off javascript...
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Sep 28th, 2001, 05:20 PM
#3
Thread Starter
PowerPoster
I know how to do it with JavaScript. But I need (want) to do it with VBScript if I can.
The reason is that I have a little script which displays a pop-up window (it isn't really an ad - its a 'tip' relevant to the site, and I don't want people to miss them by turning off JS).
But I will be adding new tip windows now and then, and my script opens one randomly by using an index which is established by counting the number of files in the directory.
I think I may have to do some DB work, but I didn't really want to for something so simple...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Sep 29th, 2001, 02:24 AM
#4
Lively Member
this is simple HTML. No fancy scripting required here, unless you want more work for your self 
Just add target="_blank"
Code:
<a href="link.htm" target = "_blank">Open new window</a>
If you think I am wierd, then thats YOUR problem!
-----------------------------------
I keep snakes and lizards, wanna know more? PM me 
-
Oct 1st, 2001, 12:36 AM
#5
Thread Starter
PowerPoster
I know HTML.
I need the windows to open automatically and randomly, so I don't want to use the simple HTML code.
I need a way with JavaScript or VBScript...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 1st, 2001, 02:16 AM
#6
Hyperactive Member
So, as chris suggested use :
window.open("NewWin.asp","regwin","TOOLBAR=NO,LOCATION=NO,DIRECTORIES=NO,STATUS=NO,MENUBAR=NO,SCROLL BARS=NO,RESIZABLE=NO,WIDTH=400,HEIGHT=450,MAXIMISE=NO");
Set the attributes of your choice.
- Jemima.
-
Oct 1st, 2001, 02:20 PM
#7
Lively Member
If you think I am wierd, then thats YOUR problem!
-----------------------------------
I keep snakes and lizards, wanna know more? PM me 
-
Oct 1st, 2001, 02:25 PM
#8
Frenzied Member
You want to use JavaScript for evil. I cannot allow that. 
If you do this in VBScript then only the IE section of your audience will see it. No other browser supports VBScript.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Oct 1st, 2001, 06:32 PM
#9
Thread Starter
PowerPoster
It is not evil. I only likened my usage to ads because of the random pop-up deal. In fact, I am using these popup windows for a legitimate purpose - it is to give a random tip to visitors to the company site. People want these tips...
Anyways. I'd prefer to use Server-Side VBScript. Netscape users can view the results of a server-side VBScript process in ASP Pages. And I really need to use VBScript to approach it the way I am, because as far as I know, JavaScript doesn't have any of the counting files functions I am using.
The only other way I can see to approach the problem is to use a database, which I am not keen to do, for a number of reasons, the main one being that the length of text varies considerably from tip to tip, and I don't really want to write compex scripts to pull the required text out of a db. Its easier for me to just put up a new tip page and have the script count them and choose one to display. That is all done, but I need the popup functionality of JavaScript...
ANYONE???
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 2nd, 2001, 11:03 AM
#10
Black Cat
Use server-side VBScript to dynamically write client-side Javascript.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Oct 2nd, 2001, 05:19 PM
#11
Thread Starter
PowerPoster
I'd considered doing that.
I got my VBScript to write the appropriate JS function into the header, but I couldn't work out how to then call that function automatically. Putting a call in the <BODY> tag (i.e - onLoad = function() ) didn't seem to work...
How would I implement this suggestion?
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 3rd, 2001, 03:52 AM
#12
Fanatic Member
Originally posted by JemimaChadwick
So, as chris suggested use :
window.open("NewWin.asp","regwin","TOOLBAR=NO,LOCATION=NO,DIRECTORIES=NO,STATUS=NO,MENUBAR=NO,SCROLL BARS=NO,RESIZABLE=NO,WIDTH=400,HEIGHT=450,MAXIMISE=NO");
Set the attributes of your choice.
- Jemima.
Thank you for agreeing with me Jemima.
-
Oct 3rd, 2001, 05:29 AM
#13
Hyperactive Member
-
Oct 3rd, 2001, 05:44 AM
#14
Fanatic Member
I dunno.. I just wanted to thank you for agreeing with me... not many people do..
-
Oct 3rd, 2001, 05:49 AM
#15
Hyperactive Member
hey chris, u r right. Not many ppl do. I wanted to acknowledge ur thanks. That too many ppl don't. Well lets say, "We'll stand by the RIGHT (or left??)"
k cool! 
- Jemima.
-
Oct 3rd, 2001, 08:15 AM
#16
Lively Member
Actually I dunno if the Question was ever answered, but no you can not do it with server side script. Pretty simple way of thinging about it. You want to open a window on the Client Side. ASP is Server Side. there is nothing you can do on the server side to make things happen on the client side.
You need to use Javascript to do this. Plain and simple. That's it. You can use the serverside to write the javascript dynamically but that is it.
You can do it with VBscript on the client side, however, the requirements for it is not and IE browser like was said previously because there are IE browsers for Mac, and Unix and Linux. but the requirement is a Microsoft Windows Operating System. Netscape will run VBscript clientside too as long as it is on a windows.
-
Oct 3rd, 2001, 05:33 PM
#17
Thread Starter
PowerPoster
Cheers
Thanks everyone for your help.
I'll see what I can come up with...
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
May 15th, 2003, 02:43 AM
#18
New Member
You could use javascript setTimeout. This way you can do a new window at random times...
-
May 19th, 2003, 07:56 PM
#19
Hyperactive Member
rjlohan when you come up with a solution, a workaround do let us know about it.
-
May 19th, 2003, 08:06 PM
#20
Hyperactive Member
What i can think of is that u make - the script and subroutine on the fly using vbscript..something like this...and call it on some event..
<% crlf = chr(10) & chr(13)
response.write "<script>" & crlf
response.write "sub openwindow" & crlf
response.write "window.open " & chr(34) & "URL..." & chr(34) & crlf
response.write "end sub" & crlf
response.write "</script>" & crlf %>
hope i understood ur problem and making some sense
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|