If i want to pass an element to a javascript function, like say a selected element, how would i do it?
ex :
this.getElementXPath = function(element)
{
if (element && element.id)
return '//*[@id="' + element.id + '"]';
else
return this.getElementTreeXPath(element);
};
The above is the code that i have to get the XPath of an element. How can i pass the selected element to it?
Thanks,
Arjun
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am not sure how exactly you combine CSSBox with JavaScript. Currently, there is no built-in javascript support in CSSBox and I am not aware about any cotnext where you could pass a Java object directly to a JavaScript function. Are you using some javascript implementation such as Rhino?
Radek
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If i want to pass an element to a javascript function, like say a selected element, how would i do it?
ex :
this.getElementXPath = function(element)
{
if (element && element.id)
return '//*[@id="' + element.id + '"]';
else
return this.getElementTreeXPath(element);
};
The above is the code that i have to get the XPath of an element. How can i pass the selected element to it?
Thanks,
Arjun
I am not sure how exactly you combine CSSBox with JavaScript. Currently, there is no built-in javascript support in CSSBox and I am not aware about any cotnext where you could pass a Java object directly to a JavaScript function. Are you using some javascript implementation such as Rhino?
Radek