English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a website that was finished by a programmer. I now need to make some changes. I am teaching myself html. The following is an example of how the programmer used it.
//if there is nothing in the customers cart, redirect them to the shopping cart page. Can someone please tell me what function the // is doing?

2006-08-21 00:39:57 · 7 answers · asked by Jenia T 1 in Computers & Internet Programming & Design

7 answers

It is a javascript comment.. you won't see that in the browser, it's just a comment for the developer (so he knows, what he'd done there)... but it's javascript, not html comment! (meaning )

2006-08-21 00:44:12 · answer #1 · answered by cyngus65 3 · 0 0

The // is the symbol for comment in a Javascript line in HTML. This means anything to the right of the // will not be executed by the Javascript engine. This is useful to include some description of what the next few lines will do

For example:





Note than in an HTML line (outside the Javascript block), the // will get printed out.

2006-08-21 07:48:29 · answer #2 · answered by ReTrOMaN 1 · 0 0

It really depends where you found it in your page.

If it's part of a shopping cart, chances are that it belongs to a server side programming language like PHP.

So if it's between this type of code:
it's going to be a php comment from the programmer to explain the purpose of the line(s) of code after the comment. In your example the redirect if the shopping cart is empty.

If it's between a , it's as another poster said, a javascript comment.

Sidenote 1:
HTML comments are written as follows:


Sidenote 2:
// only allows you to comment on one line
if you find /* some comments that span over
many lines */ it does the same.

Hope this elps

le_gber

2006-08-21 07:57:59 · answer #3 · answered by le_gber 3 · 0 0

Its a javascript comment tag. Whenever u want to make a line comment i.e. that line will not be displayed on screen whenever u display ur site in browser. You just place // before that line.

This is for he help of designers / developers.

Note :

If u want to make a set of paragraph as comment just place your para in between /*.........*/

eg. /* paragraphh text */

2006-08-21 07:58:32 · answer #4 · answered by Web Designer 2 · 0 0

Jenia T // what ever you write between this it will not be shown on web site or your INDEX or other pages. // these we use for remark //
so if we find other company to work for and someone takes over our stuff where we left. Then they know what we have done and what it needs to do. Therefore // stroke means REMARK

2006-08-21 07:47:30 · answer #5 · answered by Joe_Young 6 · 0 0

// the symbol is used to add remarks above the line of code

2006-08-21 07:46:09 · answer #6 · answered by kartoos5050 2 · 0 0

pinay ka ba? kung pinay ka send mo ko ng message sa email ko pra lubos kung maunawaan para baka matulungan kita
infotective@yahoo.com

2006-08-21 08:06:02 · answer #7 · answered by wanderer 1 · 1 0

fedest.com, questions and answers