Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling objects to run

Status
Not open for further replies.

codeone

Programmer
Mar 25, 2003
343
US
hey,

got a quick question...

I have an object which loads Notepad and it loads on load of the html doc and I would like to be able to postpone the action until I call it to run from a button, heres my code:

Code:
<object Classid="clsid:blah blah blah blah" codebase="c:\windows\notepad.exe"></object>

How would I setup the above code to run via onClick of a button?

thanks

co
 
Without the CLSID, it's hard to say whether this would work or not... Can you post it and we'll see:

Code:
<html>
<head>
<script type="text/javascript">
<!--
	function launchNotepad() {
		document.getElementById('hiddenDiv').innerHTML = '<object Classid="clsid:blah blah blah blah" codebase="c:\windows\notepad.exe"></object>';
	}
//-->
</script>
</head>
<body>
<form><input type="button" value="Launch Notepad" onclick="launchNotepad();"></form>
<div id="hiddenDiv" style="display:none;"></div>
</body>
</html>

Dan
 
Hey Billy,

thanks alot for that script, I dont know the clsid ...lol they are way to long for me to remember by heart, but I will try it when I leave work and will post my results tommorrow...

thanks

Co
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top