• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

define an href into a JS function?

Tinman

OSNN One Post Wonder
#1
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.

 

Tinman

OSNN One Post Wonder
#2
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 posts

Latest profile posts

Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,961
Messages
673,239
Members
89,015
Latest member
oggeytom