发送带有浏览器功能和屏幕尺寸等的电子邮件

发布于 2024-09-03 14:19:22 字数 1126 浏览 8 评论 0原文

我的很多访问者都是盲人(这是一个盲人网站),通常在尝试诊断问题时,我想知道他们正在使用什么版本的浏览器等,是否安装了 Flash。因为通常情况下,有人会发誓他们正在使用 X,而实际上安装了 Y。目前,我正在使用 http://jsbrwsniff.sourceforge.net/usage.html 管道到一封电子邮件中,但我这里有两个问题:

首先,jsbrwsniff 相当“重”,自 2007 年初以来就没有更新过,所以结果中有很多 -1。

其次,如果我按如下方式调用它,页面将重新加载:

电子邮件反馈

如果我这样调用它,页面变成空白,看起来像是在尝试无限加载空白页面:

电子邮件反馈

在这里亲眼目睹这场噩梦: http://kingston.talking-newspapers.co.uk/

现在,我知道那里这里和其他地方有 1001 篇文章和评论说“不要使用浏览器嗅探器,它们可能会被欺骗(等等)”,但说实话,您必须相信我,当您与某人交谈时,这是一个非常有用的工具当他们点击错误的窗口开始时,他们的“老年”并通过“帮助>关于”使用屏幕阅读器!

无论如何,我在网站中使用 jquery,并且我知道 $jQuery.browser 和 $jQuery.support,但这些并没有告诉我我需要的元素(例如是否安装了 Flash,以及什么版本等)。我到处寻找满足我需求的 jquery 插件,但没有成功。

最后,如果我必须坚持当前的 jsbrwsniff 方法,那么这并不是世界末日,但如果有人知道一种启动用户电子邮件客户端的方法,其中填充了我需要的信息,但不刷新或清空页面,我'我很想知道。

顺便说一句 - 不使用网络表单是有充分理由的,这仅仅是因为屏幕阅读器用户更容易使用他们习惯的电子邮件客户端。

谢谢!

A lot of my visitors are blind (with it being a site for the blind), and often when trying to diagnose problems, I'd like to know what version of browser etc they're using, whether flash is installed. Because more often than not, someone will swear they are using X, when in fact Y is installed. Currently, I'm using http://jsbrwsniff.sourceforge.net/usage.html piped into an email, but I've got 2 problems here:

First of all, jsbrwsniff is quite "heavy" and hasn't been updated since early 2007, so there's a lot of -1's in the result.

Secondly, if I call it as follows, the page reloads:

<a href="#" onclick="sendEmail()">Email feedback</a>

And if I call it like this, the page goes blank and looks like it's trying to infinitely load a blank page:

<a href="javascript:sendEmail()">Email feedback</a>

See the nightmare for yourself here:
http://kingston.talking-newspapers.co.uk/

Now, I know there are 1001 articles and comments here and elsewhere saying "don't use browser sniffers, they can be spoofed (etc)", but honestly, you'll have to trust me that this is a significantly useful tool when you're talking someone in their more "senior years" and using a screenreader through "help > about", when they've clicked the wrong window to start with!

I'm using jquery anyway in the site, and I'm aware of $jQuery.browser and $jQuery.support, but these don't tell me the elements I need (like whether Flash is installed, and what version etc). I've looked everywhere for a jquery plugin for my needs, with no luck.

Finally, if I have to stick to the current method of jsbrwsniff then it's not the end of the world, but if anyone knows a way of launching the user's email client populated with the information I need but WITHOUT refreshing or blanking the page, I'd love to know.

BTW - there's a good reason for not using a webform, which is simply because it's easier for the screen-reader user to use an email client they are used to.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

柠檬心 2024-09-10 14:19:22

在我看来,该电子邮件绝对应该从服务器端发送。

您可以向 PHP 或其他服务器端脚本发出包含您正在嗅探的所有信息的 Ajax 请求。该脚本将接收数据并发送电子邮件。这样就可靠多了。

除此之外,您能否强调您的确切问题 - 是嗅探部分,还是发送部分......?

Tthat E-Mail should definitely be sent from the server side IMO.

You could make an Ajax request containing all the information you are sniffing to a PHP or other server side script. That script would receive the data and send the E-Mail. It's much more reliable that way.

Other than that, can you emphasize your exact question - is it the sniffing part, or the sending part...?

左岸枫 2024-09-10 14:19:22

当用户想要提交浏览器详细信息时,您可以动态创建一个表单(例如在隐藏的 DIV 中),其中包含您需要的所有详细信息,并使用 mailto: 操作 URL 调用用户电子邮件客户端。有关详细信息,请参阅 http://www.javascript-coder。 com/javascript-form/javascript-email-form.phtml

但我不知道如何自动发送邮件。这似乎超越了浏览器的安全性。因此,您的用户仍然需要单击“发送”。

When the user want's to submit the browser details, you could dynamically create a form (e.g. in a hidden DIV) that contains all the deails you need and inoke the users email client by using a mailto: action URL. For details, see http://www.javascript-coder.com/javascript-form/javascript-email-form.phtml

But I'm not sure how to get the mail automatically sent. That would seem to transcend the security of the browser. So, your users will still have to click send.

南薇 2024-09-10 14:19:22

您是否考虑过使用 mailto: 打开邮件客户端并获取将信息收集到电子邮件中?

我不确定您的 jquery 是否可以将您收集的信息格式化为 href 链接,但如果是这样,您可能正在寻找这样的东西:

<a href="mailto:[email protected]?subject=This%20is%20the%20subject&[email protected]&body=This%20is%20the%20body">mail</a>

Have you considered using mailto: to open the mail client and get the collected information into an email?

I'm not sure if your jquery can format the information you collected into a href link, but if so something like this may be what you're looking for:

<a href="mailto:[email protected]?subject=This%20is%20the%20subject&[email protected]&body=This%20is%20the%20body">mail</a>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文