0

我正在尝试在 FileMaker 中操作 Web 查看器,以便我可以将零件型号传递到网页,以便 Web 查看器加载我正在查看的任何零件的搜索结果。我可以通过 Google 和 eBay 轻松做到这一点,因为它们通过地址栏接受搜索查询 - 我所要做的就是在 Web 查看器的输入字段上运行计算以返回,例如“http://www.google .com" + [部件号字段]。但是,我们需要通过 POST 提交搜索的网站之一(据我所知)。

关于如何做到这一点的任何想法?

4

2 回答 2

3

Have the web viewer calculate its URL something like this:

data:text/html,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>Submit Form</title>
</head>
<body onload="document.forms['my_form'].submit()">
<form action="http://www.search-engine.com/target-page.php" method="post" id="my_form">
    <input name="part_number" type="hidden" value="39845" />
</form>
</body>
</html>

What this does is hard-code in a form with the required fields, submitting to the search engine. The neat trick is the little bit of javascript triggered on page load that promptly submits the form.

(Also note the use of the data:text/html header that allows you to specify the content of the web viewer page, rather than fetching that content from server.)

于 2011-11-25T00:36:46.140 回答
2

查看ScriptMaster,它允许在 FileMaker 中执行Groovy(据我所知是 Java 衍生产品)代码。该插件是免费的,并且包含的​​ FileMaker 文件具有一个名为“将数据发布到 URL”的功能,它应该已经完成​​了这项工作。它将允许您在文件启动时将该函数“注册”为外部函数,以便您可以PostDataToURL( key; value; url )从任何 FileMaker 计算中调用。

于 2011-03-17T23:35:31.947 回答