Determine if element is a select, if so fill it with data from another object
I tried to decipher your code, and express it in pseudo-code:

for each view:
    request view data from server
    for each view:
        for each &lt;select&gt; element with dataParent in view:
            find view where view.name == dataParent
            if found and has data:
                load &lt;select&gt; with data from that view


So you load data for each view, but then you also go through all other views to pass this data to them when they happen to need it. However you don't only pass the data from currently loaded view, but you try to cover all the views (some of which have not been loaded yet).

So the first optimization to make is to eliminate this third loop through all the views. Just passing the data from currently loaded view to the views that need it:

for each view (loadedView):
    request view data from server
    for each view:
        for each &lt;select&gt; element where dataParent == loadedView.name:
            load &lt;select&gt; with data from that loadedView


That's better, but we still need to loop through all the views to find out which ones need our data. Perhaps there are hundreds of views and only three need the data.

A better approach would be to use a publish-subscribe model. Instead of having to loop through all the views, each view that needs data would subscribe itself on the view who's data it needs. When the data for that view is loaded, it would publish this data to all its subscribers

For example:

viewA = new View();
viewB = new View();
viewC = new View();
viewA.addListener(viewB);
viewA.addListener(viewC);
// load view A, which will also push data to views B &amp; C
viewA.loadData();


Each view would have an array of its subscribers. .addListener() method would add a new item to this array. And in loadData(), after the data has been fetched from server, we'd loop through this subscribers array and call a method like addData() on each view.