JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old February 7th, 2004, 11:56 PM
ocean ocean is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 18 ocean User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
window.open problem

Hey guys i encountered a problem recently....I am trying to creat a link to a window where the user can write down his name email and message and send it to a cgi script i installed in netfirms.com.....anyways everything is fine except from <A tag when its click the window pops but the window where its clicked from the whole window clears and this is shown '[object]'....what am i doing wrong......this is the code for the <A> tag im using.
Code:
<a href="javascript:window.open('http://mdomain.netfirms.com/mailadmin.htm','newwindow','width=400','height=350  ')";>Open window</a>

Last edited by stumpy : February 8th, 2004 at 06:58 AM. Reason: Please only show necessary code, and use the [code] tags.

Reply With Quote
  #2  
Old February 8th, 2004, 06:55 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
The window.open method only takes 3 parameters - filename, window name and features. You have your features split up - width and height need to be within the single quotes together, not separately.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old February 9th, 2004, 01:46 PM
meezee meezee is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 meezee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Try using:

href="javascript:var win=open('http....

Hit me back if it works.

That should do it double dog!
-Meezee

Last edited by meezee : February 9th, 2004 at 01:49 PM. Reason: want to tell him to hit me back if it worked...

Reply With Quote
  #4  
Old February 9th, 2004, 04:59 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Actually meezee, you should always use the correct DOM referecing, so when calling the 'open' method, you should preface that with 'window' - and there is no need to return the value.

Reply With Quote
  #5  
Old February 9th, 2004, 07:09 PM
ocean ocean is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 18 ocean User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks guys but i solved my problem....it seems that rather than adding the script in the <a> tag it works when I call a function from the <A> tag...so i just defined a function in the header and called it from <A> works fine...pretty weird ay..the functions got the same script its just returning...

Reply With Quote
  #6  
Old February 9th, 2004, 07:13 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Check your window.open call - did u fix the parameters problem? It works either way, but I bet you've fixed the bug I pointed out first up.

Reply With Quote
  #7  
Old February 9th, 2004, 10:01 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Quote:
Originally Posted by ocean
... script in the <a> tag it works when I call a function from the <A> tag...
Just noticed you've used a different case for your "a" tags. The new HTML specification (XHTML) requires that all HTML elements are written using lower case. While you can still use either case for HTML 4 (& 4.01), it's recommened you use lower case now to makes life easier on yourself later. Here's a few other differences in the XHTML spec, if anyone's interested - http://www.w3.org/TR/xhtml1/#diffs

Reply With Quote
  #8  
Old February 21st, 2004, 12:31 PM
capsrock capsrock is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 capsrock User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

My question deals with the window.open method but what I am trying to do is dynamically size the height of the new window by using a variable. At first I tried using some asp code to run through my database and count the items for that day then multiply that times 100 and assign it to an Application variable. I couldn't seem to pass the value of that variable to the javascript so I've tried using if statements right in the script which is working fine. The problem is when I call the window.open code and try to pass the variable to it it's not recognizing it. Here is an example of the code:

Code:
function fwLoadMenus() {
dayName = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
now = new Date
var winsize = 0
if (dayName[now.getDay()] == "Monday")
winsize = 600;
if (dayName[now.getDay()] == "Tuesday")
winsize = 400;
if (dayName[now.getDay()] == "Wednesday")
winsize = 550;
if (dayName[now.getDay()] == "Thursday")
winsize = 450;
if (dayName[now.getDay()] == "Friday")
winsize = 350;
if (dayName[now.getDay()] == "Saturday")
winsize = 250;
 
fw_menu_3.addMenuItem("TODAYS CLASSES", "window.open('events.asp', 'Classes', 'toolbar=no, status=no, width=320, height=winsize');");


I've only included the parts of the code that are affected but it's taken from my dropdown menu script. When I hard code the height it works fine. I've tried adding different brackets around it, different quote configurations, you name it. I even tried calling an include file and using the asp variable directly: height=<%Application("winsize")%> or height=<!-- #include file=getheight.asp-->

Any suggestions would be greatly appreciated.

Reply With Quote
  #9  
Old February 21st, 2004, 07:24 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
"winsize" is a variable, not a constant, therefore it needs to be seperated from the window.open statement. Like this:
Code:
fw_menu_3.addMenuItem("TODAYS CLASSES", "window.open('events.asp', 'Classes', 'toolbar=no, status=no, width=320, height=" + winsize + ");");

Reply With Quote
  #10  
Old February 22nd, 2004, 08:57 PM
capsrock capsrock is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 capsrock User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks so much for the help. It was driving me crazy. I couldn't understand why I was able to pop an alert(winsize); in my code and see that the variable contained a value but it wasn't being seen by the other code.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > window.open problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway