Нужен совет пользователей Python + pyQt4+jQuery плагин
Есть плагин который подсвечивает нужное слово на Qwebpage
Код плагина:
jQuery.fn.highlight = function(searchString, lenient) { var input = ""; if (lenient) { input = createAccentRegexp(searchString); } else { input = searchString.toUpperCase(); } return this.each(function() { setHighlight(this, input); }); function setHighlight(node, pattern) { var skip = 0; // Do this only for text nodes. Else go find child nodes... if (node.nodeType == 3) { var index = 0; // If lenient then the pattern is expected to be a regexp. if (lenient) { index = node
Правильно ли я передаю праметри в даную функцию?
[code python] def highlightAllLinks(self):
code = """$('a').each(
function () {
$(this).css('background-color', 'yellow')
}
)"""
self.view.page().mainFrame().evaluateJavaScript("""$(document).ready(highlight('слово для выделения',
false) {$('#content').css('background-color', 'yellow');});""")[/code]
желтым цветом
Правильно ли записано?:
[code python]("""$(document).ready(highlight('слово для выделения',
false) {$('#content').css('background-color', 'yellow');})[/code]