2011-05-19 85 views

回答

5

設置上WebViewenable-file-access-from-file-uris屬性:

view = webkit.WebView() 
settings = view.get_settings() 
settings.set_property('enable-file-access-from-file-uris', 1) 
view.open('file://./foo.html') 

示例文件foo.html其寫入的內容file://./bar.html進入人體:

<html> 
<head><script type="text/javascript" src="jquery-1.4.4.js"></script></head> 
<body><script> 
$.ajax({url: 'file://./bar.html', success: function(data) { 
    document.write(data); 
    } 
}); 
</script></body></html> 
+1

謝謝謝謝你 – znetor 2011-05-19 22:59:31

+1

@znetor不客氣,祝你的程序好運! – samplebias 2011-05-19 23:07:26