Jump to content

aleksanteri

Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by aleksanteri

  1. I don't understand the first question.If you want to have animated images, here is the HTML code.<html><head><script type="tex/javascript"><!--var firstImg = ImageFilename1 // image to display by defaultvar secondImg = ImageFilename2 // image to display when the cursor is on top of buttonfunction rollOver(id){document.getElementById(id).src = secondImg}function rollOut(id){document.getElementById(id).src = firstImg}// --></script></head><body><a onmouseover="rollOver('myImg')" onmouseout="rollOut('myImg')"><img src="SameImageThanOnImageFilename1-VariableAtTheScript" id="myImg" /></a></body></html> This code is handy if you have multiple images with the same src. You just need to change the 'myImg' part. Note that the id at "rollOut('here')" needs to match the image's id. The onmouseover and onmouseout attributes must also be in the <a> tag because the <img> tag does not support mouse events!
  2. Yes!Let me demonstrate it. <html><head><style type="text/css">table.examp_table, td{border-color: #00f;}</style></head><body><table border="2" class="examp_table"><tr><td>Cell 1</td><td>Cell 2</td></tr><tr><td>Cell 3</td><td>Cell 4</td></tr></table></body></html> Check this page for a reference to CSS borders
  3. aleksanteri

    Php and apache

    EasyPhp, I gave up on it. Instead, I think that I found another way to get it working on my computer.I installed PWS and used it as localhost to my ASP files, I did the Windows install on PHP.net and configured it (in the install program) to work with the PWS. However, when I try to open my PHP files, I get a 403 error (that's the "no rights, forbidden"-error). That means: How do I round this problem?
  4. I don't think so. At least I haven't seen such script yet.
  5. 13.I started studing HTML quite end of December 2005 but I learned it quickly (actually I took "View Source" of all web pages I went through and took them as examples. I learned that way.)Before I got here, my basic syntax was pretty like this: <html><head><title>This is a test title</title><font size=10 face="Verdana"><body bgcolor=#ffffff color=#000000 link=#0000ff alink=#ffffff></head>This is text<font size=25>This is a header</font></body></html> In April, I found on a website the <link rel="stylesheet" type="text/css" href="style.css"> line. I loaded the style.css but I didn't understand anything! Then I searched "CSS Tutorial" with Google, got this web site, learned CSS and the layout of multiple pages.Then I decided to take a scripting language pretty soon. I thought JavaScript was a really complex language so I took VBScript. After VBScript I thought I could take now JavaScript.Later, I took XHTML and found out that my syntax was opposite pretty much all XHTML rules! In May, I took the ASP tutorial. I installed PWS but I didn't get it working! (as ususal)As ASP didn't work, I took PHP too but you might know what happened... or didn't work.Throughout May I was making VBS/JS experiments, made a calculator with JS and took HTML DOM.Now, yesterday, I got my PWS working and now I did an ASP file manager with DHTML. It opens the Localhost folder and opens an ASP file.What's the future? I think I will try to get PHP working with my PWS. But who knows...
  6. aleksanteri

    Help~~

    Oh.Hmmm, $_SESSION[] is an array because of the [].add this, it should print the $_SESSION[]. foreach($_SESSION[] as $output){print("$output<br />")} It could be a clue. I don't know this too fine, I have never been able to view my PHP files, I might not be able to solve, someone better can crack. Nevertheless, I still try to help.BTW, how you make it work with a localhost?
  7. aleksanteri

    Help~~

    Are you able to give a link to the website? Solving a problem is a lot easier when you see it yourself.
  8. OPERA SOLVE: I think that the use of "position:absolute; top: xxx;" should take this problem. Note no "left:xxx" or all will be put on top of each other, I wouldn't recommend it that much.IE SOLVE: Haven't got this one yet...
  9. I also think that when your XML is: <?xml version="1.0" encoding="ISO-8859-1"?><bookstore><book category="COOKING"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> <order>1</order></book><book category="CHILDREN"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> <order>2</order></book><book category="WEB"> <title lang="en">XQuery Kick Start</title> <author>James McGovern</author> <author>Per Bothner</author> <author>Kurt Cagle</author> <author>James Linn</author> <author>Vaidyanathan Nagarajan</author> <year>2003</year> <price>49.99</price> <order>3</order></book><book category="WEB"> <title lang="en">Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price> <order>4</order></book></bookstore> , you could select the "XQuery Kick Start" and "Harry Potter" books by using: set nodes=xmlDoc.selectNodes("/bookstore/book[order > 1 && order < 4]/title") I am pointing at the order element, I think that it should work too this way.
  10. Giving moderators moderator colours? Why not?
  11. Hi.I'm sorry but PHP hides source, if you can select "View Source" while running the site, I should have an idea of this thing.
  12. aleksanteri

    Php and apache

    But my only problem is that I can't get it to work!Now, I have easyphp installed, do I need to do what to open the PHP files?
  13. aleksanteri

    Php and apache

    NOOOOOOOO!!!!!!So I have been at least a hundred times installing and re-installing PHP and MySQL and Apache and I could just get EASYPHP and it all could work?
  14. 1. Try...catch. More chances getting results2. Try...catch should be used right after function like this: function myFunction(){try{if(){// code}else{}}catch(err){// handle error catching}} 3. I need to agree on this one, I also saw this javascript.internet.com - Snippets - getElementsByClass having a getElementByClass() function snippet if that's what you are asking.4. Yes I need to agree on this one too. You may take an object and explore it (for example the Math object and make an extracool calculator) or then do arrays or go on to ASP.5. I quess this has been also answered.6. I think that you need to add the <a> links into a page and add the time functions to the other page and the date functions to the other. Or you could do a clock and show them all in the same block of code 7. They also might want you to learn as much functions as you can. If you ever try to make a digital clock on your desktop (what I did but I failed), or something, you need these functions.
  15. <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" /><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript"><!--function createTableData(txt){ document.getElementById("xmlTable").innerHTML = txt}function createXml(){ try { loadXml() } catch(err) { txt="Error in the source code.\n\n" txt+="Error description: " + err.description + "\n\n" txt+="Error line: " + err.line + "\n\n" txt+="Click OK.\n\n" alert(txt) }}function getValueByName(name){ var value value = document.getElementByName(name).value return value}--></script><script src="onerror.js"></script><script type="text/vbscript"><!--function loadXml() set xmlDoc=CreateObject("Microsoft.XMLDOM") xmlDoc.async="false" xmlDoc.load(getValueByName("file")) set x=xmlDoc.getElementsByTagName(document.xml.tag1.value) set y=xmlDoc.getElementsByTagName(document.xml.tag2.value) set z=xmlDoc.getElementsByTagName(document.xml.tag3.value) set v=xmlDoc.getElementsByTagName(document.xml.tag4.value) dim txt for i = 1 to x.length txt = "<tr><td>" & x.item(i-1).text & "</td><td>" & y.item(i-1).text & "</td><td>" & z.item(i-1).text & "</td><td>" & v.item(i-1).text & "</td></tr>" next createTableData(txt)end function'--></script></head><body><h1>XML Viewer</h1><form name="xml"><input type="file" name="xmlFile" /><input type="button" onclick="createXml()" value="Submit" /><table border="1"><tr><th><input type="text" name="tag1" /></th><th><input type="text" name="tag2" /></th><th><input type="text" name="tag3" /></th><th><input type="text" name="tag4" /></th><span id="xmlTable"></span></table></form></body></html>
  16. If you look for JS validating, use try...catch or onerror at the JS tutorial. But one thing pointed me to the eye.This: <script type="text/javascript"><!-- get content for each mont from db, repeat until 1 year is shown--></script> Comments in JS should be // comment, not <!-- comment --> because <!-- comment --> is for HTML, // comment for JavaScript.
  17. I tried switching the "all" to "body" but it didn't work (not if I had thought the problem was at the left side, not at the right side) thanx
  18. I have been thinking about a way to change the font family for all elements in a document with JavaScript/DOM?I have tried it with a onerror script but it doesn't help me this time. function newfont(){ document.all.style.fontFamily=document.getElementByName("NewFont").value} Plz help
  19. I had the problem when I put the "=\"" as the quote maker but when I got the error, I changed it to '="' but it didn't work. Now how I fix the problem? I have no idea...
  20. I tried to do a thingy that creates XML tags, just for JS practise, but I got an error I can't get through. It says that I'm missing a semicolon... <html><head><title>XML Builder</title><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" /><style type="text/css"><!--body {background-color : #eeeeee; color : #002f88; font-family : verdana, sans-serif;font-size : 12px; } a {background-color : #eeeeee; color : #0000ff; } a:visited {background-color : #eeeeee; color : #0000ff; } a:hover {color : #000000; background-color : #ddddff; } h1 {font-size : 30px; text-align : center; font-weight : 900; } h2 {font-size : 25px; text-align : center; font-weight : 700; } h3 {font-size : 22px; font-weight : 600; } h4 {font-size : 20px; font-weight : 300; } h5 {font-size : 17px; font-weight : 200; } h6 {font-size : 16px; font-weight : 150; } ul.nomarkers {list-style-type : none; } img {border : 0; } th{background-color:#404040;color:#00FF00}--></style><script src="onerror.js" type="text/javascript"></script><script type="text/javascript"><!--function errorMessage(doesExist, caption){this.doesExist = doesExist;this.caption = caption;}function doXml(){ // get values var element = document.XmlForm.element.value; var attr1 = document.XmlForm.attr1.value; var attr2 = document.XmlForm.attr2.value; var attr3 = document.XmlForm.attr3.value; var attr4 = document.XmlForm.attr4.value; var attr5 = document.XmlForm.attr5.value; var value1 = document.XmlForm.value1.value; var value2 = document.XmlForm.value2.value; var value3 = document.XmlForm.value3.value; var value4 = document.XmlForm.value4.value; var value5 = document.XmlForm.value5.value; var inner = document.XmlForm.inner.value; // validate element if(element == "") { errorMessage.doesExist = 1 errorMessage.caption = "Your Xml element is not correct: \nYou have no element name!" } else if(element == "xml" || element == "XML" || element == "xMl" || element == "XMl" || element == "xmL" || element == "Xml" || element == "xMl" || element == "xML" || element == "XmL") // phew pretty long eh? { errorMessage.doesExist = 1 errorMessage.caption = "Your Xml element is not correct: \nYou shall not use \"" + element + "\" in your element name" } if(errorMessage.doesExist = 1) { alert(errorMessage.caption); } var attrnbr = new Array(); // let the comparation begin if(attr1 != "") { attrnbr[1] = "true" } else { attrnbr[1] = "false" } if(attr2 != "") { attrnbr[2] = "true" } else { attrnbr[2] = "false" } if(attr3 != "") { attrnbr[3] = "true" } else { attrnbr[3] = "false" } if(attr4 != "") { attrnbr[4] = "true" } else { attrnbr[4] = "false" } if(attr5 != "") { attrnbr[5] = "true" } else { attrnbr[5] = "false" } var str; str = "<" + element if(attrnbr[1] = "true") { str = str + " " str = str + attr1 '="' // ERROR LINE!!! str = str + value1 + "\"" } if(attrnbr[2] = "true") { str = str + " " + attr2 "=\"" + value2 + "\"" } if(attrnbr[3] = "true") { str = str + " " + attr3 "=\"" + value3 + "\"" } if(attrnbr[4] = "true") { str = str + " " + attr4 "=\"" + value4 + "\"" } if(attrnbr[5] = "true") { str = str + " " + attr5 "=\"" + value5 + "\"" } str = str + "></" + element + ">"}// --></script></head><body><h1>XML Builder</h1><form name="XmlForm"><table border="1" ><tr><th colspan="4"><p>Please fill in the form</p></th></tr><tr><td><input type="text" name="element" /></td><td colspan="3"><p>Element</p></td></tr><tr><td><input type="text" name="attr1" /></td><td><p>Attribute 1</p></td><td><input type="text" name="value1" /></td><td><p>Value 1</p></td></tr></tr><tr><td><input type="text" name="attr2" /></td><td><p>Attribute 2</p></td><td><input type="text" name="value2" /></td><td><p>Value 2</p></td></tr></tr><tr><td><input type="text" name="attr3" /></td><td><p>Attribute 3</p></td><td><input type="text" name="value3" /></td><td><p>Value 3</p></td></tr></tr><tr><td><input type="text" name="attr4" /></td><td><p>Attribute 4</p></td><td><input type="text" name="value4" /></td><td><p>Value 4</p></td></tr></tr><tr><td><input type="text" name="attr5" /></td><td><p>Attribute 5</p></td><td><input type="text" name="value5" /></td><td><p>Value 5</p></td></tr><tr><td><input type="text" name="inner" /></td><td colspan="2"><p>InnerHtml</p></td><td><input type="button" onclick="doXml()" value="Submit" /></td></tr><tr><td colspan="4"><input type="text" name="output" size="70" /></td></tr></table></form></body></html> onerror.js onerror=handleErrvar txt=""function handleErr(msg,url,l){txt="There was an error on this page.\n\n"txt+="Error: " + msg + "\n"txt+="URL: " + url + "\n"txt+="Line: " + l + "\n\n"txt+="Click OK to continue.\n\n"alert(txt)return true} Can you fix the problem? I dunno how to do this...
  21. Oh my god... EDIT: I would like to know do you need the apache server for this.
  22. Actually I don't think that you need semicolons in external js files. But I use semicolons though. I have wrote C code (basic though) and I continue the habit because I need to learn more C and I don't want to forget the importance of the semicolons
  23. And how do you do that then? Sorry... I haven't understood this thing yet... Do I need to create a folder with the PHP files and then add the support folders (apache, php, mysql) and IE can open it?My thing is that I can view PHP files like in internet, like here. Can you give any steps, when I have got the php, mysql and apache? I have never done something like this before.Gahh, this is too hard, I will do ASP.
  24. So: If I can't read PHP files in IE, I have got a ftp server, you mean that I should put the PHP support into the server and then in the same folder the PHP files and it should work? Or how?
×
×
  • Create New...