QWebView not loading external javascript?

后端 未结 3 984
失恋的感觉
失恋的感觉 2021-01-16 05:51

It is possible to load an external javascript file from the html using QWebView?

In the following QtProject (all files in the same directory) there is javascript cod

3条回答
  •  情歌与酒
    2021-01-16 06:28

    If you want to load a local html file, first you need to change the src attribute of the javascript, for example:

    then src is changed to src="'file:///D:/home/myWeb/js/myjs.js'"

    this will work. Relative path can also be given.

提交回复
热议问题