Rectangle 27 4

You can also check out this answer for more details or a post by Scott Hanselman detailing the problem. Core of the problem is outdated browser detection files on the server such that IE11 is an unknown browser (and therefore lacking Javascript support according to the server).

asp.net - IE11 - Unable to get property 'PageRequestManager' of undefi...

asp.net telerik internet-explorer-11 scriptmanager
Rectangle 27 4

You can also check out this answer for more details or a post by Scott Hanselman detailing the problem. Core of the problem is outdated browser detection files on the server such that IE11 is an unknown browser (and therefore lacking Javascript support according to the server).

asp.net - IE11 - Unable to get property 'PageRequestManager' of undefi...

asp.net telerik internet-explorer-11 scriptmanager
Rectangle 27 3

var value = event.originalEvent.clipboardData.getData("Text");

Thank you. Will this work in Chrome? Wondering how I can have it function for both browsers.

You can try adding a browser check validation if not

So as it turns out, I modified 'text/plain' to 'Text' and I am still getting the same error in IE...

javascript - "Unable to get property 'getData' of undefined or null re...

javascript excel google-chrome internet-explorer
Rectangle 27 2

if (window.clipboardData && window.clipboardData.getData) { // IE
    pastedText = window.clipboardData.getData('Text');
}
else if (event.originalEvent.clipboardData && event.originalEvent.clipboardData.getData) { // other browsers
    pastedText = event.originalEvent.clipboardData.getData('text/plain');
}

javascript - "Unable to get property 'getData' of undefined or null re...

javascript excel google-chrome internet-explorer
Rectangle 27 1

Unable to get property 'length' of undefined or null reference
Cannot read property 'length' of undefined

Use ajax.dataSrc option to specify data property (account) in your Ajax response containing the data.

Your code was also missing proper columns.data options.

Change your initialization options as follows:

$('#resultDiv1').dataTable({
    // ... skipped other options ...
    "ajax": {
       "url": url,
       "dataSrc": "account"
    },
    "columns": [
        {"data": "id"},
        {"data": "rel"},
        {"data": "fin"},
        {"data": "date"}
    ]
});

javascript - jQuery DataTables: Uncaught TypeError: Cannot read proper...

javascript jquery jquery-plugins datatables
Rectangle 27 1

/** IE9, IE10 and IE11 requires all of the following polyfills. **/
 import 'core-js/es6/symbol';
 import 'core-js/es6/object';
 import 'core-js/es6/function';
 import 'core-js/es6/parse-int';
 import 'core-js/es6/parse-float';
 import 'core-js/es6/number';
 import 'core-js/es6/math';
 import 'core-js/es6/string';
 import 'core-js/es6/date';
 import 'core-js/es6/array';
 import 'core-js/es6/regexp';
 import 'core-js/es6/map';
 import 'core-js/es6/set';

thank you....this solved my issue and i am able to open app in IE11, but now i am getting another Error on console which relates to something like "SCRIPT5022: SecurityError polyfills.bundle.js (6375,25)"....so have you face this issue also? ...

Unable to get property 'apply' of undefined or null reference in angul...

angular
Rectangle 27 2

If you judge by the C++ standard, you cannot get a null reference because you get undefined behavior first. After that first incidence of undefined behavior, the standard allows anything to happen. So, if you write *(int*)0, you already have undefined behavior as you are, from a language standard point of view, dereferencing a null pointer. The rest of the program is irrelevant, once this expression is executed, you are out of the game.

However, in practice, null references can easily be created from null pointers, and you won't notice until you actually try to access the value behind the null reference. Your example may be a bit too simple, as any good optimizing compiler will see the undefined behavior, and simply optimize away anything that depends on it (the null reference won't even be created, it will be optimized away).

Yet, that optimizing away depends on the compiler to prove the undefined behavior, which may not be possible to do. Consider this simple function inside a file converter.cpp:

int& toReference(int* pointer) {
    return *pointer;
}

When the compiler sees this function, it does not know whether the pointer is a null pointer or not. So it just generates code that turns any pointer into the corresponding reference. (Btw: This is a noop since pointers and references are the exact same beast in assembler.) Now, if you have another file user.cpp with the code

#include "converter.h"

void foo() {
    int& nullRef = toReference(nullptr);
    cout << nullRef;    //crash happens here
}

the compiler does not know that toReference() will dereference the passed pointer, and assume that it returns a valid reference, which will happen to be a null reference in practice. The call succeeds, but when you try to use the reference, the program crashes. Hopefully. The standard allows for anything to happen, including the appearance of ping elephants.

You may ask why this is relevant, after all, the undefined behavior was already triggered inside toReference(). The answer is debugging: Null references may propagate and proliferate just as null pointers do. If you are not aware that null references can exist, and learn to avoid creating them, you may spend quite some time trying to figure out why your member function seems to crash when it's just trying to read a plain old int member (answer: the instance in the call of the member was a null reference, so this is a null pointer, and your member is computed to be located as address 8).

So how about checking for null references? You gave the line

if( & nullReference == 0 ) // null reference

in your question. Well, that won't work: According to the standard, you have undefined behavior if you dereference a null pointer, and you cannot create a null reference without dereferencing a null pointer, so null references exist only inside the realm of undefined behavior. Since your compiler may assume that you are not triggering undefined behavior, it can assume that there is no such thing as a null reference (even though it will readily emit code that generates null references!). As such, it sees the if() condition, concludes that it cannot be true, and just throw away the entire if() statement. With the introduction of link time optimizations, it has become plain impossible to check for null references in a robust way.

Null references are somewhat of a ghastly existence:

Their existence seems impossible (= by the standard), but they exist (= by the generated machine code), but you cannot see them if they exist (= your attempts will be optimized away), but they may kill you unaware anyway (= your program crashes at weird points, or worse). Your only hope is that they don't exist (= write your program to not create them).

I do hope that will not come to haunt you!

c++ - Is null reference possible? - Stack Overflow

c++ reference null language-lawyer
Rectangle 27 8

(function() {
    /**Array*/
    // Production steps of ECMA-262, Edition 5, 15.4.4.14
    // Reference: http://es5.github.io/#x15.4.4.14
    if (!Array.prototype.indexOf) {
        Array.prototype.indexOf = function(searchElement, fromIndex) {
            var k;
            // 1. Let O be the result of calling ToObject passing
            //    the this value as the argument.
            if (null === this || undefined === this) {
                throw new TypeError('"this" is null or not defined');
            }
            var O = Object(this);
            // 2. Let lenValue be the result of calling the Get
            //    internal method of O with the argument "length".
            // 3. Let len be ToUint32(lenValue).
            var len = O.length >>> 0;
            // 4. If len is 0, return -1.
            if (len === 0) {
                return -1;
            }
            // 5. If argument fromIndex was passed let n be
            //    ToInteger(fromIndex); else let n be 0.
            var n = +fromIndex || 0;
            if (Math.abs(n) === Infinity) {
                n = 0;
            }
            // 6. If n >= len, return -1.
            if (n >= len) {
                return -1;
            }
            // 7. If n >= 0, then Let k be n.
            // 8. Else, n<0, Let k be len - abs(n).
            //    If k is less than 0, then let k be 0.
            k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
            // 9. Repeat, while k < len
            while (k < len) {
                // a. Let Pk be ToString(k).
                //   This is implicit for LHS operands of the in operator
                // b. Let kPresent be the result of calling the
                //    HasProperty internal method of O with argument Pk.
                //   This step can be combined with c
                // c. If kPresent is true, then
                //    i.  Let elementK be the result of calling the Get
                //        internal method of O with the argument ToString(k).
                //   ii.  Let same be the result of applying the
                //        Strict Equality Comparison Algorithm to
                //        searchElement and elementK.
                //  iii.  If same is true, return k.
                if (k in O && O[k] === searchElement) {
                    return k;
                }
                k++;
            }
            return -1;
        };
    }
})();

Just being pedantic but MDN is not just Mozilla. It is a community driven project that contains Mozilla staff but also volunteers, anyone can join and contribute.

How to fix Array indexOf() in JavaScript for Internet Explorer browser...

javascript internet-explorer internet-explorer-8 cross-browser
Rectangle 27 0

Well You Understand it all Wrong

Function.prototype.showMsg = function () {
    alert("This is a sample message.");
};

function Person() {
    this.name = "Mahesh";
};

var personObj = new Person();
personObj.prototype.showMsg();

First you prototyped the function class, then create a custom class called Person, then you create an instance of Person. And then you are calling the very blue print which is showMsg which is 2 Mistakes 1 showMsg is not Bounded into the Person and then to call it if its bounded you call it directly like this

personObj.showMsg()

Will To Make This Script Work from my point of View if i got you write write it like this ->

function Person() {
 this.name = "Mahesh";
};

Person.prototype.showMsg = function () {
  alert("This is a sample message.");
};

var personObj = new Person();
personObj.showMsg();

my script bound the showMsg Directly to the Person Class if you need it through the Person Object and Through The Function Class To Then you have to inherit from Function Class Like This

Function.prototype.showMsg=function () {
   alert("This is a sample message.");
    };

function Person() {
   this.name = "Mahesh";
    };


Person.prototype = Function;
Person.prototype.constructor = Person;

var personObj = new Person();
personObj.showMsg();

But then how can I make a property or method to appear as a part of all functions and their instances???

Function
prototype

Can't becuase any function in the world have a return type and even if you didnt define the return type in JavaScript its by default is Undefined

javascript - Unable to get property of undefined or null reference - S...

javascript prototype
Rectangle 27 0

You need to pass the autocomplete to the function like

function initialize() {fillinAddress(autocomplete)}
function fillinAddress(autocomplete){console.log(autocomplete);}

When you call autocomplete = new google.maps.places.Autocomplete It possible that dont return some result, so autcomplete = null or undefined

Thanks for your help. I think that the google function does not work when I set a default value by function.

events - Unable to get property of undefined or null reference javascr...

javascript events
Rectangle 27 0

I noticed a javascipt error "unable to get property ui of undefined or null reference". The answer is that instead of asp:ScriptManager you need to use ajaxToolkit:ToolkitScriptManager in order for Ajax controls to be rendered in a proper way.

asp.net - Modal popup always visible? - Stack Overflow

asp.net ajax asp.net-ajax ajaxcontroltoolkit modalpopupextender
Rectangle 27 0

You can only call done() once in a promise chain, and that must be at the end of the chain. In the problematic code, the done() function is called twice in the promise chain:

You can use .join to merge to promise chains to complete when both are complete. I think that's what your tring to get to. Just use the result of the .then, and you'll be good

windows 8 - Unable to get property 'done' of undefined or null referen...

windows-8 winjs
Rectangle 27 0

Your source seems to contain parts, which are not selectable in the line:

to get rid of the problem you could insert the follwing:

src_array[g] = document.getElementById(src_array[g]);

if(src_array[g] != undefined) {
    if(src_array[g].selectedIndex < 0){ alert("Please select a " + src_array[g].name); return;}
}

ofcourse, you would then also need to change your further code - for example you shouldnt go for src_array[0] directly - without checking whether it is undefined or not

update: since i don't know the purpose of your code, i ll try to complete it as far as i can - IMPORTANT: this won't fix the fact that your first element is undefined. Something in your src is wrong OR the element does not exists even though it should.

function passMultiList(src, selected)
{
    dst = parent.frames['downright'].document.getElementById('chosen');
    var src_array = src.split("_");

    for(g=0; g<src_array.length; g++){
        src_array[g] = document.getElementById(src_array[g]);
        if(src_array[g] != undefined) {
            if(src_array[g].selectedIndex < 0){ alert("Please select a " + src_array[g].name); return;}
        }
    }
    if(src_array[0] != undefined) {
      for(i=0; i<src_array[0].options.length; i++){
        if(src_array[0].options[i].selected==true){
            var text = src_array[0].options[i].text;
            var value = src_array[0].options[i].value;
            if(src_array.length==1){
                flag = 0;
                for(k=0; k<dst.options.length; k++)
                {
                    if(dst.options[k].value == value)
                    {
                        flag=1;
                    }
                }
                if(flag==0)
                {
                    dst.options[dst.options.length]=new Option(text, value);
                    if(selected == 1)
                    {
                        dst.options[dst.options.length-1].selected=true;
                    }
                }
            } else {
                passList(src_array, 0, text, value, selected);
            }
        }
      } 
   }
}

You could however try to fix this by pushing the correct entries into a new array:

var src_pushed = [];
if(src_array[g] != undefined) {
    src_pushed.push(src_array[g]);
            if(src_array[g].selectedIndex < 0){ alert("Please select a " + src_array[g].name); return;}
}
for(i=0; i<src_pushed[0].options.length; i++){

javascript - Unable to get property 'selectedIndex' of undefined or nu...

javascript internet-explorer
Rectangle 27 0

This is undefined behaviour, I believe. The standard does not stipulate when the LHS of the assignment is evaluated compared to the RHS. If *ptr is evaluated after the function is called, you will be dereferencing a null pointer; if it is evaluated before the function is called, then you get sane behaviour.

The code is thoroughly disreputable. Do not try using it, or anything similar, in real code.

Note that there is a sequence point immediately before a function is called, after its arguments have been evaluated; there is also a sequence point immediately before a function returns. Thus, there are sequence points related to the evaluation of the function arguments and its return value, but...and this is crucial in this context...it still does not tell you whether *ptr is evaluated before or after the function is called. Either is possible; both are correct; the code depends on which happens, which makes it rely on undefined behaviour.

c - Assignment and pointers, undefined behavior? - Stack Overflow

c pointers variable-assignment undefined-behavior
Rectangle 27 0

If you are using winstore-jscompat.js, try adding it after adding jQuery mobile.

jQuery Mobile Windows Store App: JavaScript runtime error: Unable to g...

javascript jquery jquery-mobile cordova windows-phone-8
Rectangle 27 0

try
{
    // Assign a sender, recipient and subject to new mail message
    MailAddress sender =
        new MailAddress("sender@johnnycoder.com", "Sender");

    MailAddress recipient =
        new MailAddress("recipient@johnnycoder.com", "Recipient");

    MailMessage m = new MailMessage(sender, recipient);
    m.Subject = "Test Message";

    // Define the plain text alternate view and add to message
    string plainTextBody =
        "You must use an email client that supports HTML messages";

    AlternateView plainTextView =
        AlternateView.CreateAlternateViewFromString(
            plainTextBody, null, MediaTypeNames.Text.Plain);

    m.AlternateViews.Add(plainTextView);

    // Define the html alternate view with embedded image and
    // add to message. To reference images attached as linked
    // resources from your HTML message body, use "cid:contentID"
    // in the <img> tag...
    string htmlBody =
        "<html><body><h1>Picture</h1><br>" +
        "<img src=\"cid:SampleImage\"></body></html>";

    AlternateView htmlView =
        AlternateView.CreateAlternateViewFromString(
            htmlBody, null, MediaTypeNames.Text.Html);

    // ...and then define the actual LinkedResource matching the
    // ContentID property as found in the image tag. In this case,
    // the HTML message includes the tag
    // <img src=\"cid:SampleImage\"> and the following
    // LinkedResource.ContentId is set to "SampleImage"
    LinkedResource sampleImage =
        new LinkedResource("sample.jpg",
            MediaTypeNames.Image.Jpeg);
    sampleImage.ContentId = "SampleImage";

    htmlView.LinkedResources.Add(sampleImage);

    m.AlternateViews.Add(htmlView);

    // Finally, configure smtp or alternatively use the
    // system.net mailSettings
    SmtpClient smtp = new SmtpClient
          {
              Host = "smtp.bigcompany.com",
              UseDefaultCredentials = false,
              Credentials =
                  new NetworkCredential("username", "password")
          };

    //<system.net>
    //    <mailSettings>
    //        <smtp deliveryMethod="Network">
    //            <network host="smtp.bigcompany.com"
    //              port="25" defaultCredentials="true"/>
    //        </smtp>
    //    </mailSettings>
    //</system.net>

    smtp.Send(m);
}
catch (ArgumentException)
{
    throw new
        ArgumentException("Undefined sender and/or recipient.");
}
catch (FormatException)
{
    throw new
        FormatException("Invalid sender and/or recipient.");
}
catch (InvalidOperationException)
{
    throw new
        InvalidOperationException("Undefined SMTP server.");
}
catch (SmtpFailedRecipientException)
{
    throw new SmtpFailedRecipientException(
        "The mail server says that there is no mailbox for recipient");
}
catch (SmtpException ex)
{
    // Invalid hostnames result in a WebException InnerException that
    // provides a more descriptive error, so get the base exception
    Exception inner = ex.GetBaseException();
    throw new SmtpException("Could not send message: " + inner.Message);
}

Send mail script in asp.net with c# - Stack Overflow

c# asp.net
Rectangle 27 0

The common issue with ASP.NET pages, specially if you use MasterPages.

IDs

One solution for your problem is to give these elements a unique class and use it in the selector instead of their IDs:

<asp:DropDownList ID="ddlCity" runat="server" CssClass="stdFldWidth ddlCity" onchange="setFDFlag()">
</asp:DropDownList>    

<asp:DropDownList ID="ddlState" runat="server" CssClass="stdFldWidth ddlState" DataSourceID="dsUSState"
    DataTextField="US_State" DataValueField="State_ID" AutoPostBack="true" > 
</asp:DropDownList>
$(function () {
    var states = {
        AL: ['Birmingham', 'Montgomery', 'Tuscaloosa'],
        FL: ['Miami', 'FtLauderdale', 'Jacksonville'],
        GA: ['Atlanta', 'Macon', 'Athens']
    };

    function populateSelect() {
        $('.ddlCity').empty();

        var stateSelected = $('.ddlState').val();

        if (stateSelected) {
            states[stateSelected].forEach(function (sel) {
                $('<option>').val(sel).text(sel).appendTo($('.ddlCity'));
            });
        }
    }

    populateSelect();

    $('.ddlState').on('change', function() { 
        populateSelect();

        return true;
    });
});

Edited using @sebnukem recommendation to keep the data in an object, so you can get rid of the eval().

Updated by placing the whole code within the jQuery document ready event handler.

Updated by returning true in the jQuery onchange event handler for the DropDownList, to carry on with the PostBack.

I updated my original post with the codebehind. I tried adding the values to ddlCity in the codebehind, but it didnt work. I was thinking jquery would be an easier option.

Your codebehind doesn't seem to be taking part in the problem stated in the question.

Which part? I've updated the answer, now having all the Javascript/jQuery code within the document ready event handler - $(function () { });. And I don't believe you have an issue in your codebehind that could be messing up with this code - causing the Javascript error stated in your question.

Ah, sure. I've forgotten to add the call to the populateSelect(). Try the updated answer (just edited) again please.

jquery - JavaScript runtime error: Unable to get property 'forEach' of...

jquery asp.net drop-down-menu master-pages
Rectangle 27 0

The .classList property is not supported in IE9. Use a more traditional way of adding/removing classes as shown here: Adding and Deleting from objects in javascript

The variable declarations are in a separate function, which runs on readyState == "complete". I'll change my question to reflect that,

@Nix - see my latest version of the answer.

Yep. I think that's it, but SO won't let me accept an answer so soon. I'll try it out, and accept later. Thanks!

javascript - IE9 unable to get property 'remove' of undefined or null ...

javascript internet-explorer-9
Rectangle 27 0

var suprDD = eval('document.getElementById.col1LIAB_SUPERVISOR_CODE') // is not corrent.
document.getElementById("") //use this or 
eval('document.getElementById("")').

javascript - SCRIPT5007: Unable to get property 'length' of undefined ...

javascript internet-explorer-11
Rectangle 27 0

oEditor.OnClientLoad = "OnClientLoad"

Note the removed () at the end of the function name.

any other javascript errors on the page? Is there a link we can see it? What if you completely remove the OnClientLoad event handler?

telerik - Unable to get property 'get_contentArea' of undefined or nul...

telerik radeditor