JavaScript 的Console log 测试小例

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Console log 测试</title>
</head>
<body>
	<h1>Console log 测试</h1>
	<input type="button" onclick="testConsole()" value="Console log 测试">
	<dl>
		<dd></dd>
	</dl>
	<script type="text/javascript">
		function testConsole(){
			var full_url="media://192.168.1.101/DoDo/DaoLang-PiZheYangPiDeLang.wma&lt;刀螂-披着羊皮的狼&rt;lyric://192.168.1.101/DoDo/DaoLang-PiZheYangPiDeLang.lrc"
    		console.log(full_url)
		}
	</script>
</body>
</html>


Qt 客户端的测试方法

重载下面的函数:

void QWebPage::javaScriptConsoleMessage(const QString & message, int lineNumber, const QString & sourceID) [virtual protected]

This function is called whenever a JavaScript program tries to print a message to the web browser's console.
For example in case of evaluation errors the source URL may be provided in sourceID as well as the lineNumber.
The default implementation prints nothing.


即可接收.

你可能感兴趣的:(qt)