Closing a window using javascript

I am using the self.close() method to close a popup window. I keep getting a message saying "The webpage you are viewing is trying to close the window. Do you want to close this window?" Is there any way to just have the window close without this message popping up? Suggestions would be great or a link to a tutorial.
apriigemAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RoonaanCommented:
You can only close windows that are opened using javascipt.
Try to open the popup using window.open, rather than target="_blank".

-r-
0
apriigemAuthor Commented:
I don't know if that will work. I opened the window from Flash. I have a form that I created in Flash that sends and email with some information in it. Is there a way to make that work with Flash?
0
Kiran Paul VJComputer EngineerCommented:
hi apriigem,

this will work fine for u,

in flash
on (release) {
getURL("javascript:n_name=window.open('filename.htm','new_name1','width=325,height=229');void(0);");
}
 
in filename.htm

<a href="javascript:window.close();">Close Me</a>

make sure run this from a server (IIS or other), otherwise it will show a security warning.

hope this helps
kiranvj
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

apriigemAuthor Commented:
Ok, I tried that and when I tried to save the file I get an error message saying "A sharing violation has occured." Don't know what that means.
0
Kiran Paul VJComputer EngineerCommented:

its not related to the code above, i guess,
try saving the file to another location and try again.

kiranvj
0
Kiran Paul VJComputer EngineerCommented:
0
apriigemAuthor Commented:
ok, i fixed the sharing violation thing. the code i have to send the email works fine until I add the code from above to it. It causes the form to not work for some reason. I now get this error message

CDO.Message.1 error '8004020d'

At least one of the From or Sender fields is required, and neither was found.

/mailform.asp, line 23

Line 23 is where I have the email sent
"ObjMessage.Send"

See, I wasn't really trying to have a popup window open up, but it seems to be a by product of trying to send the email from flash through the asp page. I hope all this is making sense. I would love it if a window didnt pop up at all.
0
Kiran Paul VJComputer EngineerCommented:

it wont work because u are not submiting the form, u are just opening a window.

and for ur question its answered, how to popup a window from flash.

and if possible try to post the code. i will try to help but it will be nice if u post that as a new question.

kiranvj
0
apriigemAuthor Commented:
My question was how to CLOSE the pop up window using javascript and I am submitting the form. What I have right now is a form in Flash that when you click on the submit button, it sends the users information to an asp page that then sends it to an email address. That works fine, but once you hit submit, a window pops up(I assume it is the asp page). I would like it for this page to close right after it pops up, but currently it just stays there and I have this random blank window open. I was trying to find a way to close the window without any further interaction from the user. THe only code I have on the asp page right now is the code to send the email. You can visit touchcreations.com and then the contact page to see what happens.
0
apriigemAuthor Commented:
Thanks, but that link you posted only tells me to do what I have already done. I already have the url in the flash movie set to the asp page. I'll figure out. Thanks.
0
Kiran Paul VJComputer EngineerCommented:
hi apriigem,

thanks for the points,
i understood ur problem very well, that u dont want to change the current window and dont want to show a popup, i will try , if i find i will post here.

and i think there is a little problem in the flash in ur site, after showing the progress of loading completely its not loading the next frame, i have to right click the flash and click play to proceed.

kiranvj
0
Kiran Paul VJComputer EngineerCommented:

hi apriigem,
chk this page , its a free guest book made with flash and asp, here they are not opening a new windows to submit form,
check the flash file and get the logic and apply in your code
http://www.smartwebby.com/web_products/flash_guestbook/guestbook_interfaces.asp

download (from the above link)
http://www.smartwebby.com/web_products/flash_guestbook/downloads/MSAccessSmartGuestBook.zip

if none works try posting this in the flash section , u will get more help there.

kiranvj

0
Kiran Paul VJComputer EngineerCommented:
0
apriigemAuthor Commented:
Thanks, I didn't know that the site wasn't loading completely. It always loads automatically for me. I will try and fix that. Thanks for the links too. :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.