Email Form Script External Question
Page 1 of 114 Replies - 1991 Views - Last Post: 24 January 2012 - 04:52 AM
#1
Email Form Script External Question
Posted 20 January 2012 - 07:36 PM
If I have some code between <script></script> tags that is visible in the source code. I can place that as a external script but how will the form know how to read the script ?
Replies To: Email Form Script External Question
#2
Re: Email Form Script External Question
Posted 21 January 2012 - 01:15 AM
the form doesn’t, and it doesn’t need to. when the parser engine of the browser comes to the <script> tag (while loading the page) it reads its content. whether that is inline code or an external file doesn’t matter.
#3
Re: Email Form Script External Question
Posted 21 January 2012 - 08:09 PM
I copied the code out of the page, placed it into a external file. Placed the external file within script tags back into the page and it broke the page ?
#4
Re: Email Form Script External Question
Posted 22 January 2012 - 03:08 AM
depends on what your script tag looks like and what you’ve written in the file.
#5
Re: Email Form Script External Question
Posted 22 January 2012 - 09:34 AM
What are the typical things that may make it break ? Bastard, I thought it would just work, arrrghhh.
#6
Re: Email Form Script External Question
Posted 23 January 2012 - 04:01 AM
typical things:
- a JS syntax error
- invalid URI
- JS content in a script tag already referencing a JS source
- executing the JS script before the DOM/page is ready (i.e. you can't access elements not yet rendered)
- sometimes it matters if you use file:// or http://
- a JS syntax error
- invalid URI
- JS content in a script tag already referencing a JS source
- executing the JS script before the DOM/page is ready (i.e. you can't access elements not yet rendered)
- sometimes it matters if you use file:// or http://
#7
Re: Email Form Script External Question
Posted 23 January 2012 - 07:24 AM
Quote
- a JS syntax error
- invalid URI
-JS content in a script tag already referencing a JS source
- executing the JS script before the DOM/page is ready (i.e. you can't access elements not yet rendered)
- sometimes it matters if you use file:// or http://
-
- executing the JS script before the DOM/page is ready (i.e. you can't access elements not yet rendered)
Can I check if the JS code is being executed before the DOM page ? From my understanding there is no JS syntax errors. There are no HTML errors in the page, that rules out any script tags that shouldn't be there. Arrrghh !
This post has been edited by Reprobus: 23 January 2012 - 07:26 AM
#8
Re: Email Form Script External Question
Posted 23 January 2012 - 07:38 AM
Reprobus, on 23 January 2012 - 03:24 PM, said:
Can I check if the JS code is being executed before the DOM page ?
JS scripts are executed when they are loaded, i.e. immediately.
Reprobus, on 23 January 2012 - 03:24 PM, said:
From my understanding there is no JS syntax errors.
did you check in the Error Console?
Reprobus, on 23 January 2012 - 03:24 PM, said:
There are no HTML errors in the page, that rules out any script tags that shouldn't be there.
did you verify that? (w3.validator.org)
#9
Re: Email Form Script External Question
Posted 23 January 2012 - 09:08 PM
Quote
did you check in the Error Console?
The only error is from a Google SEO and jQuery 1.4 but when the code was embedded into the page, these errors were not to be seen. I can't update jQuery because I have a script that won't work on newer version of jQuery.
Quote
did you verify that? (w3.validator.org)
Yes, there are no errors in the HTML. My guess is how it's being loaded, I have the script at the top of the page in the <head>, no in the <body>. How can I find what is causing me this headache.
#10
Re: Email Form Script External Question
Posted 23 January 2012 - 09:35 PM
So, when are you going to get around to showing the code you are using
or provide a link to a test site versions of what you are doing?
We can guess all day as to what you are doing wrong, but it would be faster to see!
or provide a link to a test site versions of what you are doing?
We can guess all day as to what you are doing wrong, but it would be faster to see!
#12
Re: Email Form Script External Question
Posted 23 January 2012 - 11:23 PM
there is a syntax error in contact_email.js.
#13
Re: Email Form Script External Question
Posted 23 January 2012 - 11:40 PM
Hint: You can't put HTML elements directly into a Javascript file. Javascript files are Javascript only, not the language soup most HTML files are.
#14
Re: Email Form Script External Question
Posted 24 January 2012 - 03:45 AM
The JS and Syntax error wouldn't be this ?
Quote
</script>
<script type="text/javascript">
<script type="text/javascript">
This post has been edited by Reprobus: 24 January 2012 - 03:46 AM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|