Loading Javascipt when try to load page content in a div
I’ve been working on a one-page site that dynamically loads data from various pages I created in wp-admin. Here’s the example site. For example, if you click on CONTACT, a div with the id of #panel would slide down and display a Contact Form 7 element. That’s great but if you try filling it out and submitting it, it takes you to a plain screen acknowledging your submission with a new form.
That’s not supposed to happen.
Not to mention the form results never reach me.
I’m experiencing a similar situation with a slider I’m trying to create using FlexSlider. Same problem. Content looks messed up. Try CLIENTS–>Who We Work With and you’ll see what I mean (unless I somehow fixed it).
In the case of the FlexSlider, and I realize this is bad coding, I tried placing all the JS in the page itself. It worked on it’s own but not using this dynamic loading method.
And CF7? Well, that code is already placed by the plugin itself!
So am I correct in my assumptions that these pages don’t function properly due to JS already having been loaded? If so, how can I make it where it doesn’t load until that onClick call is made?
Here’s the JQuery code I currently have in my footer. Maybe there’s something I can add here or in functions.php or similar. Anyone have any suggestions?
- The topic ‘Loading Javascipt when try to load page content in a div’ is closed to new replies.