Selecting imported children & if/else

Selecting imported children & if/else

Hi everyone. I'm having trouble with my script, and I've researched for days what might possibly be wrong with it. Perhaps someone here could spot the issue? I'd be very grateful. Cheers.

Issue #1

  1. $('.about').on("click",
  2. function () {

  3. doesItBlend = $("#mid_col").hasClass(".hide");
  4. if (doesItBlend === false) {
  5. $('#right_col').load('about.html');
  6. $('#right_col').toggleClass('hide');
  7. }

  8.       else { 
  9. $('#mid_col').load('about.html');
  10. $('#mid_col').toggleClass('hide');
  11. }
  12.       });
Above code doesn't work for me, the else-statement never gets loaded. What I am trying to accomplish is, when clicking the about class element, get the about page to load into the middle column if it's empty, and into the right column if it's not. I've tried with on("click", function) and with click(function).


Issue #2 I'm having is selecting elements that has been loaded into the document via jQuery or PHP. Neither method works for me, the CSS applies fine but I can't target the elements neither by ID, class nor parent > child, children() or find(). What am I missing? :)