the simplest example of loading jquery.js (geti it from
http://jqueryjs.googlecode.com/files/jquery-1.3.2.js and put it in the
same directory with the snippet below) after loading html and then
using jquery syntax to change the background color into red:

run it in python interactive shell or better in ipython:

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

myWebKit = QWebView()
myWebKit.show()

myWebKit.setUrl(QUrl("http://www.google.com";))

myWebKit.page().mainFrame().evaluateJavaScript(open('jquery.js').read())

myWebKit.page().mainFrame().evaluateJavaScript("""$(document).ready(function()
{ $("body").css("background", "#f00");});""")
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to