How Do I Put Javascript Into My Website Using Html? Do I Just Copy And Paste Or ?
I am trying to add some stuff to my website! I already know how to use html but when I copy and paste JS it works and I submit my site but when I view my webpage in my browser the JS that I installed does not work!
Tagged with: Copy • HTML • Into • Javascript • Just • Paste • Using • website
Filed under: HTML
Like this post? Subscribe to my RSS feed and get loads more!
Check your browser preferences to make sure javascript is enabled. If it is, then try opening the page in a different browser and see if it works. There are differences in syntax depending on which browser is parsing it. So what works in Firefox, might throw an error in IE.
Good luck.
Hello,
Step1
Create a Web page using a HTML scripting program or text editor. The first line of code for any Web page is usually a statement about the coding standard used. A typical first line would read
‘< '!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"'>‘. to indicate that the Web site will be W3 compliant in HTML 4.01 standard in English.
Step2
Insert the standard header items of
‘< 'html'>‘
‘< 'head'>‘, ‘< 'title'>‘, Web site Page Title Goes Here ‘< '/title'>‘,’< '/head'>‘
‘< 'body'>‘
These tags are used to provide the typical information required at the top of each page.
Step3
Type the tag ‘< 'script type="text/javascript"'>‘ to tell the browser that the next line(s) of code will be JavaScript. The code is based on specific action words that translate into specific actions in a Web browser. An example would be: document.write(‘Hello World!’).
‘< '/script'>‘ The browser will display “Hello World!”
Step4
Accepted protocol for Web pages is to create a line of code that will inform the user why the page does not display correctly. The code used is ‘< 'noscript'>‘
Your browser either does not support JavaScript, or you have JavaScript turned off.
‘< '/noscript'>‘
Be sure to close off the script or code with closing tags. Standard formats are used to formally close the action that each tag or code opened. The standard HTML tags of , and end each webpage.
Good Luck!
Sean Colicchio
Server Engineer
Host My Sitehttp://www.hostmysite.com/?utm_source=bb
View the source in your browser (View/Page Source or View/Source). Is the Javascript there?
If it is, do you have Javascript disabled in your browser? (You should have Javascript on the page checking for that and notifying the user if his Javascript is disabled.)
here’s an example web page:
Hey, this is the body section!
So, remember to use the onload=” parameter in the body tag
Post your website url so we can see the code and offer assistance.
Also, let us know what you expect the javascript to do.