undefined

ie下面出现Notice: Undefined index: HTTP_REFERER 的解决办法

拈花ヽ惹草 提交于 2019-12-10 14:13:26
一:问题出现 发现这一问题是在一次开发当中做了一个跳转在FF下面能正常跳转,最后将项目传到线上之后,测试的却告诉我在IE下面不能跳转,我开始还不相信,后来一测试,果真如此,经过最终的排除BUG,最后锁定了是 HTTP_REFERER这个常量的问题。 二:有的时候,在ie下面出现Notice: Undefined index: HTTP_REFERER,但是在FF下面却能正常输出 三:$_SERVER ['HTTP_REFERER'] 变量。这是什么原因呢?现我简化一下代码来讲解解决办法。 见下图一: html代码为: <body> <a href="javascript:$.dianJi();void(0)" name='lj' >点击链接进行跳转</a> </body> js代码为: <script type="text/javascript"> $(function(){ $.dianJi=function(){ location.href="http://localhost/20130426/action.php?action=check"; } }) </script> action.php页面代码为: $action=$_GET['action']; echo $_SERVER ['HTTP_REFERER']; 四:点击链接,发现,在FF下面能正常输出: 见图二: 但是

angular 4 service cannot read property 'newService' of undefined [duplicate]

爱⌒轻易说出口 提交于 2019-12-10 12:14:54
问题 This question already has answers here : How to access the correct `this` inside a callback? (10 answers) Closed last year . I am calling a method in newService and in that method I want to call the method changeMessage. The problem is that in newService.getContentReplies this.newService does not refer to an instance of NewService so it can't read the property of it. What can I do to make this work? component.ts newService.getContentReplies(this.parentAuthor, this.parentPermlink) newService

Cannot read property 'then' of undefined with JavaScript promises

筅森魡賤 提交于 2019-12-10 09:40:34
问题 I understand at first glance this may look like a duplicate but I have seen all the answers for that tell me to put a return in but that is not working. this is my function: function removePastUsersFromArray(){ pullAllUsersFromDB().then(function(users_array){ var cookie_value = document.cookie.split('=') [1]; const promises = [] for (var i = 0; i < _USERS.length; i++) { if (_USERS[i].useruid == cookie_value){ var logged_in_user = _USERS[i].useruid; promises.push( onChildValue(rootRef, 'users/

Undefined symbols for architecture i386:问题解决

試著忘記壹切 提交于 2019-12-09 19:24:49
这里优先感谢 azhou_hui ,大部分内容引用自他的博文,增加了一种错误可能,部分有增删,原文传送门 http://blog.csdn.net/azhou_hui/article/details/18312047 ***************************我是无节操的分割线**************************** 多个人共同操作同一个项目或拷贝项目时,经常会出现类似这样的问题: Undefined symbols for architecture i386: "_OBJC_CLASS_$_xx文件名", referenced from: 大概有下面4种可能,前三种网上好多人都说过了,而其中第四种情况是最近刚刚被困绕过的,如果前三种方法都使用后也不能解决,可以考虑排查一下第四种可能; 1.相关工程文件未导入 你可以直接在这里+进来,也可以在左边工程目录中把文件全部重新导人一遍(多人操作工程时,一般这种解决办法) 2. .framework文件未导入 把xx文件库+进来,本问题"_OBJC_CLASS_$_ASIdentifierManager", 就是因为 AdSupport.Framework类库未加 3.文件路径缺失 检查是否某些文件路径未加入进来或者写错了 4.所提示的文件内创建了未实现的类的对象 这种情况多是由于编码人员失误造成的,只在

setting a default value to an undefined variable in javascript

十年热恋 提交于 2019-12-09 17:30:16
问题 Ideally I want to be able to write something like: function a( b ) { b.defaultVal( 1 ); return b; } The intention of this is that if b is any defined value, b will remain as that value; but if b is undefined, then b will be set to the value specified in the parameter of defaultVal() , in this case 1 . Is this even possible? Ive been toying about with something like this: String.prototype.defaultVal=function(valOnUndefined){ if(typeof this==='undefined'){ return valOnUndefined; }else{ return

Javascript: passing a not defined variable to a function

你离开我真会死。 提交于 2019-12-09 03:46:19
问题 I have some calls to AJAX where I return a JSON object as a response. This JSON object always has the same structure. However, there are sometimes where if the PHP scripts fails, some of the objects of the JSON structure are not defined or even inexistent. This also happens with some "global" variables that are present in a page and I use in some JS files, but then go to another page where I use those JS files and the variable is not even written. So, I thought to create a function is_defined

JavaScript's equivalent to PHP's __get() magic method [duplicate]

余生颓废 提交于 2019-12-09 02:35:00
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: JavaScript getter for all properties Does JavaScript provide a method to access undefined object properties? In PHP the solution is to declare and implement __get() method in class. Solutions using try { .. } catch { .. } are not sufficient for me, because I already have very large amount of code which actually needs to stay as-is. 回答1: You may choose to write a similar functionality and check existing

“Undefined reference to” when using library in C++

我的梦境 提交于 2019-12-09 01:02:21
问题 and i was having the following problem when running some code i found on the internet from http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html: newmain.cpp:(.text+0x17): undefined reference to `cv::VideoCapture::VideoCapture()' newmain.cpp:(.text+0x35): undefined reference to `cv::CascadeClassifier::load(std::string const&)' newmain.cpp:(.text+0x5f): undefined reference to `cv::CascadeClassifier::load(std::string const&)' newmain.cpp:(.text+0x8e):

How is it legal to reference an undefined type inside a structure?

。_饼干妹妹 提交于 2019-12-08 16:31:50
问题 As part of answering another question, I came across a piece of code like this, which gcc compiles without complaint. typedef struct { struct xyz *z; } xyz; int main (void) { return 0; } This is the means I've always used to construct types that point to themselves (e.g., linked lists) but I've always thought you had to name the struct so you could use self-reference. In other words, you couldn't use xyz *z within the structure because the typedef is not yet complete at that point. But this

Datatables .row() is undefined

泄露秘密 提交于 2019-12-08 15:42:21
问题 i want to delete rows by simply clicking related Button.. data tables is works, i can use some basic function like sort and search in datatable , but when i click the button it just simply said undefined error : for your information, im using datatable 1.10 and jquery 1.10.2 Code : <table cellpadding="0" cellspacing="0" border="0" class="row-border" id="table"> <thead> <th>Video ID</th> <th>Filename</th> <th>Action</th> </thead> <tbody> <td>1</td> <td>ABCD</td> <td><input type='button' name=