I am following this series


and everything ws fine when was working with just javascrtript and html.

But now I want to put it together with php fraework and I cannnot get it to work.

It does not draw select box first of all. And does not draw contacts. Maybe if I would get the idea why it is not drawing select box, then I would undestand other things.

I commented out the code to figure out in which place things stop working.



I tried even this:

this.$el.find("#filter").append('why this does not work?????');

but does not show any changes. But when I console.log that element it is found. So element selected but does not show any text/html. Why is this?

5 Years
Discussion Span
Last Post by McLaren

What is the intend of $el?

el: $("#contacts"),

I don't know what this


means, I usually don't use such expessions, but as from tutorial there were sentences about catching or something like that - jquery cached version. I am not sure.


looks like I found the problem :D

but I don't get why is that. Nothing worked, so I eneded up deleting all html and all javascript because it has to start working at some point. So I have empty files.
Just made div #contacts, included jquery and app.js which I am wrinting.

in app.js only put the code

$(function() {
    // Stuff to do as soon as the DOM is ready;

and finally it started to work :D wow. IF this would not have worked then I really would not understand.

So I Ctrl + Z both html and app.js files to get back where I was.

And I see the difference.

Original document ready was like this:

(function ($) {
} (jQuery));

But my wokring code was as you saw

 $(function() {

And this difeerence made it work. FML.

Can somebody explain what is the difference? I thoguht its the same document ready.
ANd how this could work earlier? I mean

(function ($) {

O, did quick google search

so it is for the reason to work with other libarries. But still why it could stop working for me?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.