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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML - ASP Interaction

Status
Not open for further replies.

waltd

Programmer
Jul 7, 2001
3
US
Hi All,

I am a newby to XML. I'm not even sure all that it can do but I have a project that is making use of it so I am having to learn it. I have received some Open Source Code that has everything I need for the most part. I just need to add some more functionality. Enough chit-chat. Here is my question.

I want my XML/JScript to call a ASP Function. I am very familiar with ASP and VBScript but lacking in the area of JScript and XML.

I have an ASP file that reads as follows.

index.asp
-----------------------------------

<html XMLNS:XS>
<head>
<?import namespace=&quot;XS&quot; implementation=&quot;htmlEditor.htc&quot; />
</head>

<body style=&quot;margin: 0, 0, 0, 0;&quot;>
<XS:htmlEditor id=&quot;xsEditor&quot; onSave=&quot;alert(xsEditor.content);&quot;/>

</body>
</html>

<%
Function Whatever()
'Do whatever I want to do here
End Function
%>

------------------------------

The onSave is called by the following code which comes from htmlEditor.htc:

htmlEditor.htc
----------------------------

<public:component tagName=htmlEditor>
<public:event name=&quot;onSave&quot; ID=&quot;editorSave&quot; />
</public:component>


function buttonClick(button) {
if(command=='Save') {
var oEvent = createEventObject();
editorSave.fire(oEvent);
}
)

<span id=&quot;buttonSave&quot; command=&quot;Save&quot;
onClick=&quot;buttonClick('buttonSave');this.state=false;&quot; <img src=&quot;icon_save.gif&quot; alt=&quot;Save&quot;></span>

------------------------

This is obviously not all the code but I think it is enough for you to get the idea of what is going on. I want to call the function Whatever() from the onSave event instead of it firing the alert.

Any help would be greatly appreciated.

WaltD
 
Hi,

I'm none to sure if this is what you are asking for but have you tried just removing the alert and replacing it with the function call

onSave=&quot;Whatever()&quot;

This will normally execute in javascript

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top