Forum Replies Created

Viewing 25 posts - 376 through 400 (of 475 total)
  • Author
    Posts
  • in reply to: Hello World! And Javascript loops in WordPress? #14764
    Zac Gordon
    Keymaster

    Hi William!

    Welcome 🙂 and don’t worry, in not too long you’ll forgot how much you didn’t know and be doing quite a lot with JS.

    When we get to building complete JS themes then yes JS loops will replace PHP loops 🙂

    However, if you have a normal PHP theme it will likely still run the Loop at the PHP level.

    Hope that helps! Good question

    in reply to: 1.3.11 – Change the label #14672
    Zac Gordon
    Keymaster

    Well its also a good sign when it’s just little things like this causing problems 😉

    in reply to: 1.3.11 – Change the label #14621
    Zac Gordon
    Keymaster

    Hey @Jason,

    A few little tweaks, take a look at this and let me know if you can make sense of the differences. Small stuff:

    
     var fieldsList = document.querySelector( '.fields' ),
         firstField = fieldsList.children[0],
         firstFieldInput = firstField.querySelector( 'input' ),
         firstFieldIdStr = firstFieldInput.getAttribute( 'id' ),
         firstFieldPlaceholder = firstFieldInput.getAttribute( 'placeholder' ),
         secondField = firstField.cloneNode( true ),
         secondFieldInput = secondField.querySelector( 'input' ),
         secondFieldLabel = secondField.querySelector( 'label' ),
         secondFieldIdStr = updateIdStr( firstFieldIdStr ),
         secondFieldPlaceholder = secondField.querySelector( 'input' );
         secondFieldText = secondFieldLabel.innerText;
    
     console.log( secondFieldLabel );
    
     secondFieldLabel.setAttribute( 'label', secondFieldIdStr );
     secondFieldLabel.innerHTML = 'Field 2';
     secondFieldInput.setAttribute( 'id', secondFieldIdStr );
     secondFieldInput.setAttribute( 'name', secondFieldIdStr );
     secondFieldLabel.setAttribute( 'for', secondFieldIdStr );
     secondFieldPlaceholder.setAttribute( 'placeholder', 'Field 2 Text' );
    
     fieldsList.appendChild( secondField );
    
     function updateIdStr( value ) {
    
       var strArray = value.split( '-' ),
           id = strArray[ strArray.length - 1 ],
           newId = parseInt( id ) + 1;
    
       strArray[ strArray.length - 1 ] = newId;
       return strArray.toString().replace( ',' , '-' );
    
     }
    
    in reply to: Can't Remove Products From Cart #14547
    Zac Gordon
    Keymaster

    Hi folks, it looks like this was a little snafu due to some custom add to cart buttons and one page checkout being used together. The problem should be resolved now!

    in reply to: function style #14470
    Zac Gordon
    Keymaster

    Hi Merrill,

    This is a really good question.

    What you are seeing here is a style of writing an init method that is not necessarily a best practice but is not uncommon.

    The reason for this is mostly for readability and to keep the object declaration close to the initializing method for that object. There are not really technical difference between how init and the other methods are written and init could have been written in the same way as them and vice versa.

    When I was building this project I did try to write things in a few different ways to expose us to things like this and you did a good job to bring it up here.

    I could say more, but let me know if this answers your question for you 🙂

    Sorry for the delay in response as well. Notifications plugin reactivated!

    Zac

    in reply to: 1.3.4 #14460
    Zac Gordon
    Keymaster

    Glad you got it sorted!

    in reply to: 1.3.05 Missing how to play with these in the console #14452
    Zac Gordon
    Keymaster

    Hi @Gillian!

    I put together a little video here showing how you can set vars in the console. In this example I’m setting a variable based on an element in the DOM. You can pretty much do anything we do in these exercises in the console as well. [Sorry no sound]

    Let me know if this doesn’t answer your question.

    In terms of the actual suggestion for practice, I would say try to do some of the same things we do in the video, but just with different sites and types of DOM elements. Notice in this example we have a div with class of content but you will need to match classes, ids or other elements for other sites.

    Hope that helps!

    Zac

    in reply to: cannot start after purchase #13863
    Zac Gordon
    Keymaster

    Okay, great! Welcome 🙂

    in reply to: cannot start after purchase #13839
    Zac Gordon
    Keymaster

    Hey Lucas!

    You should have just got an email from me about this. The earlier problem mentioned was resolved, this is a little different, but please just shoot me a response to the email and we’ll get it all cleared up 🙂

    Thanks!
    Zac

    in reply to: cannot start after purchase #13450
    Zac Gordon
    Keymaster

    Hi Folks,

    My apologies, it looks like there was an issue tying the purchase to course access. It should be resolved now and you should all have access to available content!

    in reply to: Can't seem to access the classrooms #13443
    Zac Gordon
    Keymaster

    Hey Jason! You should be all set now!

    in reply to: 1.3.05 Missing how to play with these in the console #13150
    Zac Gordon
    Keymaster

    Hi Gillian,

    See if this video helps 🙂

    Should explain how to type multiple lines of code in the console.

    in reply to: Lesson 1.3.05 – variable consistency? #13143
    Zac Gordon
    Keymaster

    Hi,

    Yes, you are correct on catching this! There is actually a little note below the video pointing this out in case other folks notice the same thing. Sorry about that!

    in reply to: 1.3.05 Missing how to play with these in the console #13119
    Zac Gordon
    Keymaster

    Hi!

    You would want to do something like shift + enter for the line breaks to prevent it from executing one line at a time which won’t really be what you want.

    You should also be able to paste code blocks into the console and have them work.

    in reply to: Protecting Unsaved Content Missing? #12963
    Zac Gordon
    Keymaster

    Oops! My bad! The lesson was up but not assigned to the right section. Sorry about that, you should be all set now!!! Congrats on your progress 😀

    in reply to: can't click through the quiz #12956
    Zac Gordon
    Keymaster

    Hey Tim,

    Sorry about these delays. I haven’t really been able to duplicate the issue, but I do have the ability to wipe quiz attempts which can sometimes help if you are not getting any results at all when taking the quiz. I’m wondering if it might be a simple cookie or cache issue that might need clearing on the computer with issues.

    Sorry for the trouble, but glad you’re now on to Events!!!

    Cheers 🙂
    Zac

    in reply to: Error In Vanilla Press Quiz #12949
    Zac Gordon
    Keymaster

    Dang, right you are Jason! Sorry about that, should be all set now!!!

    in reply to: Lessons Sidebar #12513
    Zac Gordon
    Keymaster

    Hi folks! Just wanted to let you know I just added a simple toggle sidebar feature 🙂 Hope it helps navigation a bit!

    in reply to: 1.3 DOM section not being marked as completed #11949
    Zac Gordon
    Keymaster

    Hi Carme,

    So sorry for the long delay, but I finally had a suggestion for how to fix it. Could you try taking the DOM Quiz again? It should hopefully show results for you this time.

    Thanks!
    Zac

    in reply to: Lessons Sidebar #11793
    Zac Gordon
    Keymaster

    Ah yes, I have had this request once before. Once I have some time I will add that functionality 🙂

    in reply to: Link Target for Lesson 1.3.07 #11786
    Zac Gordon
    Keymaster

    Thanks Julie! Got it all fixed now 🙂

    in reply to: Files for: 1.6.1 – Introduction to VanillaPress #11298
    Zac Gordon
    Keymaster

    Hey James! Glad you found it 🙂

    I am going to leave this thread open just in case any one else has the same problem, but if you like, let me know and I’ll delete it 😉

    in reply to: Code Examples via Download #11291
    Zac Gordon
    Keymaster

    Hi Annette,

    All of the code examples at the beginning of the course are available on JSBin, I do not have downloadable copies as well.

    This is something I may be able to circle back and make available on Github, but it probably won’t be until more content is released since that is where all of my time is going at the moment.

    Apologies for the inconvenience in the meantime.

    in reply to: Event phases: bubblin', capturin' clarification #10651
    Zac Gordon
    Keymaster

    Hey Vincent!

    You completely got it 🙂 Your thought on the event starting at the target is quite common, but you are correct that the event starts at the document root and captures down first before bubbling back up from the event.

    Glad you’ve got it now 🙂

    in reply to: Video speed x 2? #10460
    Zac Gordon
    Keymaster

    Hey Silvan!

    Yes, that would be a great feature, I will look into if it is something I could easily do..

    Thanks!

Viewing 25 posts - 376 through 400 (of 475 total)