attachEvent to call function with Param
i am creating dynamic objects using vbscript and a web page, this question is not directly related to QTP but it is purely related to VBscript and DOM.
Here i am getting trouble attaching Event & calling a function with parameter
<font class="small">Code:</font><hr /><pre>
Set removelink = Document.createElement("a")
removelink.href = "#"
removelink.innerText = "Remove"
removelink.attachEvent "onclick", GetRef("removeRow")
'this is calling removeRow Function which has no parameter
removelink.attachEvent "onclick", GetRef("removeRow('manish')")
'this is NOT calling removeRow Function which has parameter
Function removeRow() 'If function called without para
msgbox "I am called"
Function removeRow(param) 'If function with without para
msgbox "I am called with " & param
I am stuck here [img]/images/graemlins/frown.gif[/img] any clues
Re: attachEvent to call function with Param
Yes. What you are trying to achieve might not be possible because the process scope difference. The technique you are using is applicable only when working with in HTML