日期:2014-05-19  浏览次数:20361 次

为什么这个不生效果呢?
<script   type= "text/C# "   src= "../Weather/Default.aspx "> </script>

好象没运行   Default.aspx  

有兄弟知道什么情况吗?

------解决方案--------------------
从来没这么在脚本标记中引过 C#!

不过可以肯定 ../Weather/Default.aspx 肯定不是 C#,因为它是 ASP.NET 的页面,
要引的话也应该是 .cs 文件呀?!

不知道 LZ 为啥这么做?!
------解决方案--------------------
LZ看看JAVASCRIP的书,src引用的也是脚本```你还拿它来显示网页了?
------解决方案--------------------
新建一个js文件(如Test.js),里面的代码为:
document.getElementById( 'weather ').innerHTML= ' <a href=http://comment.szonline.net/weather/weather.aspx target=_openweather> 深圳: <img border= "0 " src= "http://comment.szonline.net/weather/Images/1.gif " width= "13 " height= "13 "> <img border= "0 " src= "http://comment.szonline.net/weather/Images/1.gif " width= "13 " height= "13 "> 多云29 ℃ /22℃ </a> '

再这样引用: <script type= "text/javascript " src= "../Weather/Default.aspx "> </script>
------解决方案--------------------
再这样引用: <script type= "text/javascript " src= "../Weather/Test.js "> </script> 打错了

------解决方案--------------------
document.getElementById( 'weather ').innerHTML,这些可是javascript代码,怎么会单独在aspx里面呢,有什么意义吗?
------解决方案--------------------
改成这样type= "text/javascript "
------解决方案--------------------
哦,不会是 web service 调用吧,.asmx?

不过也没这么用的呀,怪哉怪哉!

等高人来解吧!
------解决方案--------------------
呵呵,果然可以,成了!

应该是位置问题,一定要放在 <span id= "weather "> </span> 的后边,而且不能用 C#!

代码如下:

http://localhost/temp.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN ">
<html>
<head>
<title> New Document </title>
<meta name= "Generator " content= "EditPlus ">
<meta name= "Author " content= " ">
<meta name= "Keywords " content= " ">
<meta name= "Description " content= " ">
</head>

<body>
<span id= "weather "> </span>
<script type= "text/javascript " language= "JavaScript " src= "http://comment.szonline.net/weather/default.aspx "> </script>
</body>
</html>