Jump to content

Skynet

Members
  • Posts

    7
  • Joined

  • Last visited

Skynet's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I am learning SQL and am trying to figure out the following:What is the difference(s) or advantages/disadvantages between either of these following two statments? TRUNCATE TABLE table_name or DELETE FROM table_name
  2. I noticed that you can use id and name attributes interchangebale in many cases in an HTML document.What are some instances in which one is required over another and some genaral recommendations as to which to use and whether to avoid using one or the other in some circumstances?
  3. Thank you, that explains a lot of things.Just a quick side question though. In what instances would the field return a null over a "" and vice versa?
  4. I am new to JavaScript but I am assuming that you are using something to the effect of: for (x in urlsarray) {document.write("<a href=\"urlsarray[x]\">" + urlsarray[x] + "</a>" + "<br />")// other code} The problem lies in the first part of your statement I believe. Each time the for iterates, it writes this to the HTML document <a href="urlsarray[x]">http://www.google.com</a><br /> You need to separat the "<a href=\"urlsarray[x]\">" into <a href=\"" + urlsarray[x] + "\"" "document.write("<a href=\"" + urlsarray[x] + "\">" + urlsarray[x] + "</a>" + "<br />") This should make your code work (I think).Try it and see what happens.
  5. Link in W3Schools:JavaScrpit Form Validation function validate_required(field,alerttxt){with (field){if (value==null||value=="") {alert(alerttxt);return false}else {return true}}} I am a traditional programmer (C, C++) and am learning some web development technologies like JavaScript, XHTML, CSS etc.As a more traditional programmer I am used to the C/C++/Java syntax of always including a paramater type in the argument list and following strict syntax and declaration fules. In the code referenced above, I notice that in function validate_required() that the parameter types are missing as is the norm in JavaScrpit. I can understand from the context that alerttxt is a JavaScript String object but what type of object is field?!?!This also brings me to my next question. In the same function there is a mention of a keyword(?) with in conjunction with the variable field.I do not understand the function of this keyword and how it relates to the variable field.Also, there is an undeclared identifier value in this function as well.Please help me in understanding some of the code use as well as elaborate on rules of syntax/declaration assumed in the above expample.Thank you.
×
×
  • Create New...