[PyQt] Problem with a very simple JavaScript

projetmbc at club-internet.fr projetmbc at club-internet.fr
Thu Dec 10 20:39:45 GMT 2009


Indeed in the code there is  evaluateJavaScript  instead of  evaluatejava-script .

Christophe.

============================================================================================
# -*- coding: utf-8 -*-
#!/usr/bin/env python

# Sources
#    http://www.mail-archive.com/pyqt@riverbankcomputing.com/msg17247.html
#    "jQuery" J. Chhaffer & K. Swedberg Ed. : PEARSON
    
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *

app = QApplication(sys.argv)
myWebKit = QWebView()
myWebKit.show()

myWebKit.setUrl(QUrl("simpleHtmlPage.html"))

myWebKit.page().mainFrame().evaluatejava-script(open('jquery-1.3.2.js').read())

# There is  ROUGE  in the HTML source.
myWebKit.page().mainFrame().evaluatejava-script("""$(document).ready(function(){$(".red").css("color", "#ff0000");});""")

sys.exit(app.exec_())

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20091210/975c22f4/attachment.html


More information about the PyQt mailing list