JQuery – $ is not defined

That error can only be caused by one of three things: Your JavaScript file is not being properly loaded into your page You have a botched version of jQuery. This could happen because someone edited the core file, or a plugin may have overwritten the $ variable. You have JavaScript running before the page is … Read more

Chrome sendrequest error: TypeError: Converting circular structure to JSON

It means that the object you pass in the request (I guess it is pagedoc) has a circular reference, something like: JSON.stringify cannot convert structures like this. N.B.: This would be the case with DOM nodes, which have circular references, even if they are not attached to the DOM tree. Each node has an ownerDocument which refers to document in most … Read more

Array.size() vs Array.length

Array.size() is not a valid method Always use the length property There is a library or script adding the size method to the array prototype since this is not a native array method. This is commonly done to add support for a custom getter. An example of using this would be when you want to … Read more

Array of JSON Objects

I am trying to re-implement a page using JSON instead of some 2-dimensional arrays. What I am hoping to accomplish is get an array of objects. The objects would look like this: I want to create an array of these restaurant objects and populate the distance field with some logic, then sort the array based … Read more