Webiste Loading CSS/JScript Not Completeing - Worked For Years?

www.enflow.com/index.html

Webpage Pre Loading CSS/JScript Not Completing - Not working Right…

Just Keeps re-running the initial load screen over and over.

Until a few days ago this worked right… and has been working fine for the last year.

What did we do wrong… thanks… CJ

You have some code at the bottom of your script.js that is a bug.

$(document).ready($(document).on('submit', function()
 { if ($("#question:contains('href=')").length > 0) return false; });

This is not right in that it is expecting a function in document.ready and so is confused. I am not sure if you purposely meant not to put this submit event inside of the anonymous function that ready() typically expects. Try putting this in…

$(document).ready(function() {
	$(document).on('submit', 'form', function(e) { 
	      if ($("#question:contains('href=')").length > 0) return false; 
	});
});

This should at least resolve the error and get your site loading again. We are saying that when the document is ready, we attach an event to the submit of a form and then process your code. This should get you running and on to whatever you were making.

Note: Heads up, I have no idea what your intention with this code is, so take my example with a grain of salt. It is just showing you what is wrong and how you might go about fixing it.

1 Like

Thanks Martyr2… We will try this out…

Our intention with our code… Was to check for hyperlinks in our contact form text fields and NOT allow the form to submit if there is a hyperlink in message or other fields.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.