Question: I have an HTML page (`courses.html`) that shows a list of courses. These courses are loaded from a database by an AJAX call into the array "courses" defined as global variable in `script_1.js`. Once I go to the page of a specific course in `course.html` I want to be able to pass this array to `script_2.js` to mantain the order of the courses and navigate them without having to perform the AJAX call again.

How I can pass this global variable or how I can manage this?

Answer: 
The way to approach this would to be use cookies.

An answer to a previous stack overflow question explains really well how to store javascript objects in cookies and how to retrieve them.

<https://stackoverflow.com/a/11344672/1130119>
You have a couple of options:

1) If you are developing a Single Page Application (SPA): Create a global variable to store your courses, for example:
window.courses = []; // fill with your data courses

then when you load your page 2 you could access to window.courses variable

(keep in mind that you could create a object app and store in it all variable that you need as: window.app = {}; window.app.courses = [] )

2) It's useful for SPA or classical web application: Save courses on localStorage, you could store the courses and retrieve in the next page (or download if localStorage.getItem('courses') will be undefined).