Using jquery instead of javascript with qml help
-
hi
i want to know can we use jquery library with qml? I mean to ask that when i want to access data for example from xml file or any other thing, i can use XMLHttpRequest. but what i i want to use jquery library function like $.ajax().thanks
-
I don't think it's actually possible, but you can try to extract functions and objects you need
-
how is it possible to extract functions and object? I mean how can i do this?
-
well it's actually can be complicated
you should look up what you need in jquery source and copypaste it to a new js file. you may need to remove some code, special for web, for example DOM refernces etc. also i doubt that $ will work -
In qml, you can access C++ coding, you can achieve the purpose using C++
-
so then we can use c++ code to read jquery lib correct?
any tutorial about this?
thanks before -
jQuery is browser-oriented js library. I really doubt that it is possible to port it to qml. You can use c++ not to use jquery, but to implement similar methods in c++ and use them in qml.
-
I just finished a small library so I don't have to handcraft all my ajax requests, you can find the library at https://github.com/peppelorum/ajaxmee
If you use it please let me know, if you find any bugs, please file a bug at github, or even better, fork it and pull request.