execute javascript from a defined javascript object

Luciano Montanaro luciano.montanaro at consulenti.fastweb.it
Wed Feb 18 19:32:32 CET 2004


On Tuesday 17 February 2004 13:14, caterina torrisi wrote:
> Hi all,
>  
> I need to know if there is a way to execute a javascript function defined in 
> the current html page from a javascript object that I defined. 
>  
> The function that I have to call has a parameter so I can't use the 
> KHTMLPart::executeScript( const QString &script) , which works well but the 
> script doesn't accept parameters. 
>  
> I tried to use the 
> KJScript::call(const KJS::UString &func, const KJS::List &args)
> but it causes a error like this: 
> "launcher: error sending launcherSlavePidCmd: Broken pipe" 
> 
> Can someone help me?
> 
> 
> Thanks,
> 
> 
> Caterina.

Well, you don't provide many details. However, the error message seems 
connected to the KIO subsystem.

Also, I think you are using a konqueror based on kdelibs 2.2, am I right?

I'm not much familiar anymore with that.
To pass parameters to the script, maybe you could use put() to assign 
or change some variable in the interpreter context, or you could supply 
extra functions to pass parameters to your script.

The script could call scriptFunction(yourObject.x, yourObject.y)
or yourObject.x() and yourObject.y() if you find that easier...

ciao
Luciano

PS I think plain text mail is preferred on this list
   


More information about the konq-e mailing list