Project

General

Profile

How to use Javascript functions With WT: Wanted to embed D3.js visualization in Wt webpage

Added by Manoj G almost 11 years ago

Is it possible to use javascript functions? If so, please guide me how to do it.

Wanted to try out D3/DC visualizations with WT Web page.

Thank you,

Manoj G


Replies (3)

RE: How to use Javascript functions With WT: Wanted to embed D3.js visualization in Wt webpage - Added by Georgiy Gluhoedov almost 11 years ago

void Wt::WApplication::doJavaScript     (   const std::string &     javascript,
        bool    afterLoaded = true 
    )   

Executes some JavaScript code.

This method may be used to call some custom javaScript code as part of an event response.

This function does not wait until the JavaScript is run, but returns immediately. The JavaScript will be run after the normal event handling, unless afterLoaded is set to false.

See Also
    addAutoJavaScript(), declareJavaScriptFunction()

RE: How to use Javascript functions With WT: Wanted to embed D3.js visualization in Wt webpage - Added by Wim Dumon almost 11 years ago

Search for 'Invoking JavaScript or including scripts' on the WApplication reference manual page for a more complete list of functions. You'll also need calls to require().

The examples/javascript directory also contains a simple example.

Wim.

    (1-3/3)