Well I have a site where I am trying to make a form comming up with a alert box but without submiting..
I have done this with Javascript at Codepen.
Codepen: http://codepen.io/anon/pen/xBhaL
But when I put this on my website it doesn’t work for some reasons.
Does anyone know what the problem can be..
Site: http://www.marktopper.dk/demo/blog_post.php?id=22
Please scroll down and try the comment submition.
I have put the javascript into a file called “ajax.js”, and I can see that the site gets it.
But it doesn’t seems to work like on Codepen.
I have also changed from using local jquery to using the latest jquery from their site.
But still without luck.
Your
ajax.jsis currently:-This runs before the DOM is ready. Try:
Introducing $(document).ready()