SitePoint Sponsor |
|
User Tag List
Results 1 to 9 of 9
Thread: Javascript + Active X
-
Jan 6, 2003, 18:45 #1
Javascript + Active X
HiHi~
Anyone know how to use javascript & active X to open an application?
I have a web page and want my user to be able to open an application (i.e notepad) when they click on a button.
How can this be done?
Thank you and ByeOf cos http://www.yupapa.com
-
Jan 6, 2003, 22:14 #2
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:<html> <head> <script language="javascript"> function notepad() { var WshShell = new ActiveXObject("WScript.Shell"); var oExec = WshShell.Exec("notepad"); } </script> </head> <body> <form> <input type="button" value="Open Notepad" onclick="notepad()"> </form> </body> </html>
1. Works in IE only
2. Should cause a warning like "Unsafe ActiveX blah blah..."
3. Only suitable for intranet appsLast edited by jofa; Jan 6, 2003 at 22:17.
-
Jan 6, 2003, 23:47 #3
- Join Date
- Jan 2003
- Location
- Cambridge
- Posts
- 16
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I think I should just point out that any user running Norton antivirus (with script blocking on, the default) will get a big red scary Malicious script alert if they try and run this, which is a bit more than the IE warning. The recommended option shuts down explorer.exe.
Other AV software should also be assumed to do this, so give the user a fair warningWhen you can't see the angles no more..no more no more no more.. You're in Trouble..
..trouble ..trouble ..trouble
-
Jan 7, 2003, 14:48 #4
I tried the code and gave me an javascript error on line 6...
I don't use notorn anti virus... i am the only one using the code... it is for my school project...Of cos http://www.yupapa.com
-
Jan 10, 2003, 15:04 #5
- Join Date
- Jan 2002
- Location
- NJ/NY
- Posts
- 346
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey. I was looking for the same thing... found a code snippet that worked for me in this thread:
http://sitepointforums.com/showthrea...en+application
Hope it helps.Forget WordPress. Launch a 300,000+ page autoscaling Job Search.
FREE GUIDES
Google Rapid Indexer - 21K in 21 Days - 7 Steps to Start a Site
-
Jan 10, 2003, 23:25 #6
THANK YOU THANK YOU!
But if you upload the html document and run it from your browser, you get a javascript error... however if you save the html document to your computer and run it locally, it works... why is this?Of cos http://www.yupapa.com
-
Jan 11, 2003, 09:40 #7
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by YUPAPA
THANK YOU THANK YOU!
But if you upload the html document and run it from your browser, you get a javascript error... however if you save the html document to your computer and run it locally, it works... why is this?
Add your site to "Trusted sites"
-
Jan 15, 2003, 13:48 #8
- Join Date
- Jan 2002
- Location
- NJ/NY
- Posts
- 346
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hey,
Can someone tell me how to modify that script so that it will open an application that uses an *.ini file?
Sorry, I'm probably not explaining myself well. Basically, I have a shortcut to a program on my desktop, and the shortcut target calls both the exe file and an ini file.
Thanks in advance.Forget WordPress. Launch a 300,000+ page autoscaling Job Search.
FREE GUIDES
Google Rapid Indexer - 21K in 21 Days - 7 Steps to Start a Site
-
Oct 30, 2003, 05:39 #9
Originally Posted by YUPAPA
Bookmarks