使用完全限定域名时 IE8 中的 JQuery / Javascript 错误
这太奇怪了,我无法弄清楚。使用 https://localhost/program/admin/menu.php 时,我没有错误。但是当我使用 FQDN (https://FQDN/program/admin/menu.php) 时,我收到 JavaScript 错误。以下是失败的函数:
$("#user-select").change(function() {
var value1 = $(this + "option:selected").html();
var attrs1 = value1.split(" ");
applyValues(attrs1[0],attrs1[1],attrs1[2]);
$("input[name=new-credential]").each(function(){
$(this).val('');
});
$( "#add-credential-form" ).dialog( "open" );return false;});
JQuery 函数失败,因为变量 value1 为 null。它没有获取选定的选项文本,我不确定为什么它在使用 localhost 而不是 URL 中的 FQDN 时会起作用。
基本上,当选择框更改时,添加凭据表单对话框将填充所选选项的文本,并且该对话框将打开。我在其他浏览器中没有任何问题。使用 FQDN 时仅限 IE8。如果重要的话,我正在使用 JQuery 1.6.2 和 JQuery UI 1.8.15。我很感谢你在这件事上的帮助。如果您需要更多信息,请告诉我。
谢谢你!
This is incredibly strange and I can't figure it out. When using https://localhost/program/admin/menu.php I have no errors. But when I use the FQDN (https://FQDN/program/admin/menu.php), I get a javascript error. Here's the function that is failing:
$("#user-select").change(function() {
var value1 = $(this + "option:selected").html();
var attrs1 = value1.split(" ");
applyValues(attrs1[0],attrs1[1],attrs1[2]);
$("input[name=new-credential]").each(function(){
$(this).val('');
});
$( "#add-credential-form" ).dialog( "open" );return false;});
The JQuery function fails because the variable value1 is null. It is not getting the selected option text and I'm not sure why it would work when using localhost as opposed to the FQDN in the URL.
Basically, when the select box changes, the add-credential-form dialog is populated with the selected option's text and the dialog is openned. I have no problems in other browsers. Just IE8 when using the FQDN. If it matters, I'm using JQuery 1.6.2 and JQuery UI 1.8.15. I appreciate your help on this matter. Let me know if you need any more information.
Thank You!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我觉得这不对:
你是这个意思吗?
This doesn't look right to me:
Did you mean this?
尝试更改
为
“如果有效”,但我不知道为什么它可以在本地工作但不能在远程工作。
Try changing
to
If this works, I don't know why it would work locally but not remote, though.