Get the last item in an array

Update 13 July 2021 The new at() method allows you to use negative indices to mean “from the end”. You can access the last item of locArray like this: At time of update, the at() method is supported in Chrome 92+, FireFox 90+, Node 16 and Deno 1.12+ Older answer In the event that your server serves the same file for … Read more

How to read an external local JSON file in JavaScript?

You cannot make a AJAX call to a local resource as the request is made using HTTP. A workaround is to run a local webserver, serve up the file and make the AJAX call to localhost. In terms of helping you write code to read JSON, you should read the documentation for jQuery.getJSON(): http://api.jquery.com/jQuery.getJSON/

How to create a GUID / UUID

UUIDs (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDentifier), according to RFC 4122, are identifiers designed to provide certain uniqueness guarantees. While it is possible to implement RFC-compliant UUIDs in a few lines of JavaScript code (e.g., see @broofa’s answer, below) there are several common pitfalls: Invalid id format (UUIDs must be of the form … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)