页面如下<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>example</title>
<script type="text/javascript">
document.write("<p>This is an inserted.</p>");
</script>
</head><body>
<script type="text/javascript" src="example.js"/>
<script>
insertParam("This is a test.")
</script>
</script>
</body>
</html>脚本如下function insertParam(text){
var str= "<p>";
str += text;
str +="</p>";
document.write(str);
}页面中执行insertParam无输出,
在dw中页面script标签嵌套script报错。,运行时,firebug一切正常,望指点
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>example</title>
<script type="text/javascript">
document.write("<p>This is an inserted.</p>");
</script>
</head><body>
<script type="text/javascript" src="example.js"/>
<script>
insertParam("This is a test.")
</script>
</script>
</body>
</html>脚本如下function insertParam(text){
var str= "<p>";
str += text;
str +="</p>";
document.write(str);
}页面中执行insertParam无输出,
在dw中页面script标签嵌套script报错。,运行时,firebug一切正常,望指点
解决方案 »
- 提供验证URL的正则表达式~~~~~~~大虾们帮忙测试和改进!
- 如何处理jsp中用java赋值的js变量
- html页面中通过javascript可以获取session值吗?
- offsetTop在ie和firefox下的取值问题
- firefox 下 DIV 不能触发 onkeydown 事件,谁有好的建议呢?
- 梅花雪的MzPageControlTop.js大家有没有?
- radio表单处理问题
- 请问谁有以下效果的代码,急!在线等待!!
- 请问出错在那啊
- 使用Table的XML数据岛需要将每一列绑定到XML数据的每一字段上,那我的这个XML数据源该如何绑定呢?
- 怎么过去两个时间的差,然后转为时间戳
- js 如何根据IFrame里的内容修改父页面的元素的值??
<script>
insertParam("This is a test.")
</script>
改成这样看看可以不
<script type="text/javascript" src="example.js"></script>
<script>
insertParam("This is a test.")
</script>
虽然是种探索思维,但如果想出下面的情况也总比上面那种好得多:
<script type="text/javascript" src="example.js">
insertParam("This is a test.")
</script>
当然这也是不能运行的。但有种变通的方法能让它运行,离题远了就不讲了。
yahoo YUI 和 google 有类似的教程,不过没深度研究下去。
可以参考一下 https://developers.google.com/closure/compiler/docs/gettingstarted_ui?hl=it