Delphi, EmbeddedWB/TWebbrowser - jQuery not executing

前端 未结 1 632
逝去的感伤
逝去的感伤 2021-01-24 17:35

I am using EmbeddedWB (A TWebbrowser extension) to do like a \"live preview\" of some dynamically generated content.

I am trying to add jQuery into the mix, so I can get

相关标签:
1条回答
  • 2021-01-24 18:16

    It seems to work if you use correct URL for the jquery.js file:

    <script type="text/javascript" src="file://C:/jQuery.js"></script>
    <script type="text/javascript" src="file:///jQuery.js"></script>
    

    or a relative path, you can also omit the file:// protocol:

    <script type="text/javascript" src="../../jQuery.js"></script>
    

    The above works when you load the HTML from a file. The question is however, if content from memory and javascript from file system is not considered crossing a security context boundary and rejected for that reason by the embedded browser. In that case, embedding jquery directly in the HTML content (using the <script> tag) should work.

    0 讨论(0)
提交回复
热议问题