Last active
December 14, 2015 09:29
-
-
Save jeena/5065062 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, os | |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
from PyQt4.QtWebKit import * | |
app = QApplication(sys.argv) | |
web = QWebView() | |
web.page().settings().setAttribute(QWebSettings.LocalContentCanAccessRemoteUrls, True) | |
path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'index.html')) | |
url = "file://localhost/" + path | |
web.load(QUrl(url)) | |
web.show() | |
sys.exit(app.exec_()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>TEST</title> | |
<h1>TEST</h1> | |
<div id="test"></div> | |
<script type="text/javascript"> | |
function t(text) { return document.getElementById("test").innerHTML = text } | |
var xhr = new XMLHttpRequest(); | |
xhr.onreadystatechange = function() { | |
if(this.status != 0) | |
t(this.responseText) | |
else | |
t("Status is 0") | |
} | |
xhr.open("GET", "https://jeena.net/") | |
xhr.send() | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment