免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3009 | 回复: 2
打印 上一主题 下一主题

CGI 调用 单独的 javascript 文件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-03-22 14:51 |显示全部楼层 |倒序浏览
我把javascript直接嵌在cgi里面是可以的,

但是写成单独的js文件后放在apache的cgi-bin目录,失败,
cgi里面这么写的:
print start_html(-title=>'Test',
        -script=>{-type=>'JAVASCRIPT',
                -src=>'validate.js'}
);

log里面的消息:

C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/validate.js is not executable; ensure interpreted scripts have "#!" first line, referer: http://localhost/cgi-bin/1.cgi


我就放在到htdocs目录下面
cgi里面:
print start_html(-title=>'Test',
        -script=>{-type=>'JAVASCRIPT',
                -src=>'../htdocs/validate.js'}
);
结果也找不到,目录关系很困惑。。

论坛徽章:
0
2 [报告]
发表于 2010-03-22 15:26 |显示全部楼层
问题仍然出现:

C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/validate.js is not executable; ensure interpreted scripts have "#!" first line, referer: http://localhost/cgi-bin/1.cgi

(9)Bad file descriptor: don't know how to spawn child process: C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/validate.js, referer: http://localhost/cgi-bin/1.cgi

多谢关注

论坛徽章:
0
3 [报告]
发表于 2010-03-22 15:44 |显示全部楼层
那样都不能运行cgi了。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP