SYS是未定义 [英] Sys is undefined

查看:142
本文介绍了SYS是未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的工作的ASP.Net/AJAX控制套件项目。的80%的时间也没有问题。该网页运行,因为它应该。如果刷新网页时,有时会显示一个JavaScript错误SYS是未定义的。

它不发生的时间,但它是可重复的。当它发生时,用户必须关闭他们的浏览器,并重新打开页

这使我相信,这可能是一个IIS设置。

另外要注意的。我看了看页面的源代码都当我得到的错误,当没有。当页面抛出错误以下code丢失:

 <脚本src=\"/ScriptResource.axd?d=EAvfjPfYejDh0Z2Zq5zTR_TXqL0DgVcj_h1wz8cst6uXazNiprV1LnAGq3uL8N2vRbpXu46VsAMFGSgpfovx9_cO8tpy2so6Qm_0HXVGg_Y1&t=baeb8cc\"类型=文/ JavaScript的>< / SCRIPT>
<脚本类型=文/ JavaScript的>
//<![CDATA [
如果(typeof运算(系统)===未定义)抛出新的错误(ASP.NET AJAX客户端框架加载失败。');
//]]>
< / SCRIPT>


解决方案

我通过移动固定我的问题了<脚本类型=文/ JavaScript的>< / SCRIPT> 包含块Sys系统*调用低了下去(结束前的最后一项身体的< ASP:内容/> 部分)。在HTML在页面上。我本来有我的脚本块在HEAD < ASP:内容/>我页部分。我正在一个网页,有一个内部的MasterPageFile。希望这可以帮助别人了。

I have an ASP.Net/AJAX control kit project that i am working on. 80% of the time there is no problem. The page runs as it should. If you refresh the page it will sometimes show a javascript error "Sys is undefined".

It doesn't happen all the time, but it is reproducible. When it happens, the user has to shut down their browser and reopen the page.

This leads me to believe that it could be an IIS setting.

Another note. I looked at the page source both when I get the error, and when not. When the page throws errors the following code is missing:

<script src="/ScriptResource.axd?d=EAvfjPfYejDh0Z2Zq5zTR_TXqL0DgVcj_h1wz8cst6uXazNiprV1LnAGq3uL8N2vRbpXu46VsAMFGSgpfovx9_cO8tpy2so6Qm_0HXVGg_Y1&amp;t=baeb8cc" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
if (typeof(Sys) === 'undefined') throw new Error('ASP.NET Ajax client-side framework failed to load.');
//]]>
</script>

解决方案

I fixed my problem by moving the <script type="text/javascript"></script> block containing the Sys.* calls lower down (to the last item before the close of the body's <asp:Content/> section) in the HTML on the page. I originally had my the script block in the HEAD <asp:Content/> section of my page. I was working inside a page that had a MasterPageFile. Hope this helps someone out.

这篇关于SYS是未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆