define an href into a JS function?

Tinman

OSNN Newbie
Joined
9 Jul 2005
Messages
4
I found a script on this site, which was what I have been searching for , for a long time.
it's posted here:
http://www.osnn.net/articles.php?action=show&showarticle=47#programlaunch

the href of the code is:
<a onClick="exec('sol.vbs'); return false;" href="java script:void(0)">Launch Solitare</a>

I would like another JS file to call that line of code.

so am wondering how to define that line as a JS function.
I am stuck on this one, anyone willing to help?
Thanks ion advance to all who reply.
Tin.

 
Ok this is what I have figured out:

javascript:exec('switchuser.vbs') added into my navbar program

<a onClick="exec('switchuser.vbs'); return false;" href="javascript:void
(0)">Switch User</a>
added into my html

both lines work in all users
BUT
the javascript line will not work with MS "active desktop" in any of the user accounts.
I receive an "error" window:
a runtime error has occurred
line 0
error:eek:bject expected
I also get another browser window popping up with javascript:exec('switchuser.vbs')
in the address bar.

if I open up my browser (IE6 SP2) with my "home page" set as c:\mywebsite\index.htm
both lines ( the JS and the href ) will work fine for any user account.
so I am not really sure where my problem lies here.
I would expect that it's "active desktop" issue but am not sure why I am getting a runtime error.
Any thoughts?
Thank you,
Ryan.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back