informations about jquery

Kevin Krammer krammer at kde.org
Sun Dec 9 12:12:23 UTC 2012


On Sunday, 2012-12-09, Sebastian Kügler wrote:
> Hi Renato,
> 
> On Saturday, December 08, 2012 21:15:07 renato fringuello wrote:
> > Can I use jQuery framework in html/js plasmoids? How can I do it?
> 
> I don't know any details about jQuery, but can give you some hints: If
> jQuery uses the webbrowser's DOM, that's not available in QML, QML only
> supports ECMA Script, which is a subset of the JavaScript usually
> available in webbrowsers.

In theory my guess would be that it should be possible to use non-browser 
parts, e.g. the wrappers around HttpXmlRequest.

Since JavaScript only needs the symbols that are actually used in executed 
code paths, not having DOM symbols shouldn't effect those other parts.

However, jQuery being designed to run across many browsers with different 
JavaScript APIs, will use the existance or absence of certain objects or 
functions as indicators which browser it is currently being executed in.

So it is likely necessary to examine how it usually determines that it is 
running inside the JavaScriptCore [1] version that is being used by QML and 
then provide those objects/functions/values in the context used by jQuery.

Cheers,
Kevin

[1] QML in Qt5 uses V8, but I think in Qt4 it is using then same engine which 
also powers QtScript and this is a copy/fork of some JavaScriptCore version if 
I remember correctly.

-- 
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20121209/2578d65b/attachment.sig>


More information about the Plasma-devel mailing list