c语言未定义变量量

22:11 提问
使用js向页面中插入html,代码定义在变量中,但是执行的时候提示变量未定义,变量都打印的出来。
var test=text.这个text.html是json格式的获得json中的html值
alert(test);
$('#login').html(test);
这个图片是我的代码,下面这个js是远程返回一个调用js函数,内容是ajaxload({"html":"xxx"});xxx就是我上面截图打印出来的
按赞数排序
你应该是执行到else语句去了吧。。执行到else语句肯定出错了。以后要发代码。。截图还得打一次代码
setTimeout改成这样,你那样你的test需要为window作用域下的才行
else setTimeout(function(){$('#login').load(test)},1000)
$('#login').html(test);你确认是这句而不是其他的?你上面那句能输出,下面不会,会出出错的。你的login对象有更新没?
你的text是本地的还是远程返回的请求结果,如果text只是json字符串,需要转换成对象。比如JSON.parse(text)或者jQuery.parseJSON(text),如果只是测试的话,可以使用eval('('+text+')')
你的text是本地的还是远程返回的请求结果,如果text只是json字符串,需要转换成对象。比如JSON.parse(text)或者jQuery.parseJSON(text),如果只是测试的话,可以使用eval('('+text+')')
你的问题很有可能就是json字符串没有转换为json对象的问题。
你可以点击
var html就是你贴出来图片的html片段 (我把你的html片段注释了,因为觉得有点乱。我重新写了个html,把html和css以及事件尽量分离,如果你想测试你的html,你可以取消第一行的注释,然后把3-6行和15-19行注释掉)
在演示代码里面,可以正常登录和注册代码插入页面,在右上角可以看到,但是如果注释掉第11行,即text = JSON.parse(text);结果就是undefined。你自己可以在页面上面注释,然后点击页面左上角的Run运行看看结果。
其他相关推荐博客访问: 21995
博文数量: 23
注册时间:
ITPUB论坛APP
ITPUB论坛APP
APP发帖 享双倍积分
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: DB2
原因: db2start会启动环境变量db2instance定义的实例,删除实例时,系统会有提示信息:DBI1199IDB2IDROP 已成功完成。DB2INSTDEF 注册表变量已设置为被删除的实例;它已被清除。此注册表变量应显式地设置为另一有效的实例名称。环境变量db2instance仍然是旧实例。
解决方法:set db2instance=demo(新实例名)
阅读(4206) | 评论(0) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。MINITAB 提示“变量未定义”
MINITAB 提示“变量未定义”
MINITAB15在概率分布查看时提示“变量未定义”,不知为何,咨询高手!
看不到代码,只能猜测了哦,这种常见的问题来自于:
1、变量名称大小写;
2、;号的中英文状态;
3、代码引用时候发生错误。
请遵守网上公德,勿发布广告信息
相关问答:Error #1065: 变量
未定义 global/flash.utils::getDefinitionByName()
flex报的错误,完整的错误如下:ReferenceError: Error #1065: 变量
at global/flash.utils::getDefinitionByName()
at mx.utils::DescribeTypeCache$/describeType()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\utils\DescribeTypeCache.as:95]
at mx.utils::ObjectUtil$/getClassInfo()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\utils\ObjectUtil.as:829]
at mx.controls::DataGrid/generateCols()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DataGrid.as:2407]
at mx.controls::DataGrid/collectionChangeHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DataGrid.as:4132]
at mx.controls.listClasses::ListBase/set dataProvider()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:1827]
at mx.controls::DataGrid/set dataProvider()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DataGrid.as:1334]
at mx.core::Container/createComponentFromDescriptor()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3595]
at mx.core::Container/createComponentsFromDescriptors()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3493]
at mx.containers::Panel/createComponentsFromDescriptors()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\Panel.as:1528]
at mx.core::Container/createChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2589]
at mx.containers::Panel/createChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\Panel.as:1056]
at mx.core::UIComponent/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5370]
at mx.core::Container/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2526]
at mx.core::UIComponent//2006/flex/mx/internal::childAdded()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5267]
at mx.core::Container//2006/flex/mx/internal::childAdded()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3305]
at mx.core::Container/addChildAt()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2217]
at mx.core::Container/addChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2140]
at mx.core::Container/createComponentFromDescriptor()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3681]
at mx.core::Container/createComponentsFromDescriptors()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3493]
at mx.core::Container/createChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2589]
at mx.core::UIComponent/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5370]
at mx.core::Container/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2526]
at mx.core::UIComponent//2006/flex/mx/internal::childAdded()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5267]
at mx.core::Container//2006/flex/mx/internal::childAdded()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3305]
at mx.core::Container/addChildAt()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2217]
at mx.core::Container/addChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2140]
at mx.core::Container/createComponentFromDescriptor()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3681]
at mx.core::Container/createComponentsFromDescriptors()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3493]
at mx.core::Container/createChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2589]
at mx.core::UIComponent/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5370]
at mx.core::Container/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2526]
at mx.core::UIComponent//2006/flex/mx/internal::childAdded()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5267]
at mx.core::Container//2006/flex/mx/internal::childAdded()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3305]
at mx.core::Container/addChildAt()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2217]
at mx.core::Container/addChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2140]
at mx.core::Container/createComponentFromDescriptor()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3681]
at mx.core::Container/createComponentsFromDescriptors()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3493]
at mx.containers::Panel/createComponentsFromDescriptors()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\Panel.as:1528]
at mx.core::Container/createChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2589]
at mx.containers::Panel/createChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\Panel.as:1056]
at mx.core::UIComponent/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5370]
at mx.core::Container/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2526]
at mx.core::UIComponent//2006/flex/mx/internal::childAdded()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5267]
at mx.core::Container//2006/flex/mx/internal::childAdded()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3305]
at mx.core::Container/addChildAt()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2217]
at mx.core::Container/addChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2140]
at mx.core::Container/createComponentFromDescriptor()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3681]
at mx.core::Container/createComponentsFromDescriptors()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3493]
at mx.core::Container/createChildren()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2589]
at mx.core::UIComponent/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5370]
at mx.core::Container/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2526]
at mx.core::Application/initialize()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Application.as:846]
at CloudRandomForest/initialize()[E:\fansy_work\project\caic-ria\src\CloudRandomForest.mxml:0]
at mx.managers::SystemManager//2006/flex/mx/internal::childAdded()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2009]
at mx.managers::SystemManager/initializeTopLevelWindow()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3234]
at mx.managers::SystemManager//2006/flex/mx/internal::docFrameHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3064]
at mx.managers::SystemManager/docFrameListener()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2916]
TypeError: Error #1009: 无法访问空对象引用的属性或方法。
at mx.containers::Panel/commitProperties()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\containers\Panel.as:1159]
at mx.core::UIComponent/validateProperties()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:5807]
at mx.managers::LayoutManager/validateProperties()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:539]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:659]
at Function//AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8628]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8568]
这个错误在09年就有人提出来了,链接为:/problems/27570,和我的错误一样。下面是一个相对合理的解释。针对一个MXML文件:方式一: private var myId:S
或者 [Bindable] private var myId:S
方式二: private var myId:String =""; 或者 [Bindable] private var myId:String ="";方式三: private var myId:String = 或者 [Bindable]
private var myId:String =这三种方式都不行;可以使用的是 在前面加上// 也就是把它们去掉,这里需要郑重说明的一点是 myId变量在整个页面的其他地方没有用到,所以才出现了这个问题。纠结呀,搞了好久,才发现这个问题。如果在下面的界面中用到了myId这个变量,那么就不会出现这个问题了。看来也不是随便的复制别人的代码,还要每个变量都推敲一下呀。分享,成长,快乐转载请注明blog地址:https://blog.csdn.net/fansy1990请稍等 ...
采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
使用&volist name=&category& id=&vo&&
提示我未定义变量: vo
分享即可 +1积分
代码贴全点
时长16小时0分钟
BAT大牛亲授ThinkPHP 5.0,实战中学透新技能,应用于工作
PHP开发工程师
BAT界PHP资深工程师。拥有丰富的大数据、高并发处理、大型网站架构经验。曾在新浪视频负责PHP开发,CCTV6电影网项目经理,现在某大型知名互联网公司负责大数据流的开发。讲课风格激情澎湃,认真负责。
Copyright (C)
All Rights Reserved | 京ICP备 号-2}

我要回帖

更多关于 未定义函数或变量 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信