Jump to content

laczfinador

Members
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About laczfinador

  • Rank
    Newbie
  1. Cool! I thought there must be some other way, since it wasn't too convienient that I need a function to call a function with parameters... anyway... thanks for the links! I added them to my favorites for further study.
  2. Hey there!Thanks for the reply. Am I to understand, that my solution is actually the correct, traditional way of doing this? I could not understand clearly, if that was what you were saying... also... do you have any tips. where can I dive deeper into JavaScript, than what is in the online tutorial on w3schools? I have searched the internet for other tutorials and references, but all of them seem to talk about the basic stuff... not much about how to code efficiently and unobtrusively... and also... your avatar as cool!
  3. Hello World!Let's look at a simple HTML page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head> <meta http-equiv="Content-type" content="text/html;charset=utf-8" /> <link rel="stylesheet" type="text/css" href="default2.css" /> <script type="text/javascript" src="script2.js"></script></head><body><p id="text"></p></body></html> Now, let's see the corresponding script: var s=prompt("type a string","");window.onload=writeText;function writeText(){ document.getElementById("text").innerHTML=s;} This script works just fine. When page is loaded, you get a prompt, where you can enter some text. Then, the text is displayed on screen, inside the paragraph element. The problem is, that if I want to store the user input in a variable, and pass this as an argument, the script doesn't work. Here is the other script: var s=prompt("type a string","");window.onload=writeText(s);function writeText(str){ document.getElementById("text").innerHTML=str;} As far as I know, when parenthesis are written after a function's name, it is instantly executed, and the return value is passed onto the handle - instead of being attached to the event. After pondering on this for a while, I made up a solution, that seems to work. It looks as follows: var s=prompt("type a string","");window.onload=function(){ writeText(s);}function writeText(str){ document.getElementById("text").innerHTML=str;} So... can someone explain to me, why does this script work, and the one before doesn't? Thanks in advance!Cheers!
  4. Hey there gar onn!Unfortunatelly that is not the case... I need to hand-code this operation on a webpage, so that someone non-technical can edit the database entries - but thanks anyways, phpmyadmin is indeed a great application!
  5. Hello World!I am somewhat inexperienced in PHP and have stumbled upon a problem. I have a nice .php script that shows us the contents of a database table, one row per database entry. I wish to create an edit/delete button at the end of each row. I came up with a quick solution: why not use links and forward the variables with a query string to the edit/delete php script? Well, I figured, that this might not be the most secure option, because the href attribute is viewable by anyone... my question is: can anyone introduce me to some more sophisticated ways of achieveng this goal?Here is the code I am using: require("mysql_connect.php");//This page is accessible through a search form.//If the user left the username field empty,//every user should be listed. There will be//an else statement where pattern matching is used...if($_GET['username']==""){ $sql="SELECT * FROM users"; $result=mysql_query($sql);}while($row=mysql_fetch_row($result)){echo $row[1]." - ".$row[2]."(".$row[3].")<br />";}echo "<a href=\"newuser.htm\">back</a>";
  6. Hey guys! Sorry for disappearing without any trace. I appreciate your willingness to help, but I managed to solve the problem on my own though. It is not a real solution though, but visually it looks the same. Cheers!
  7. Hi there!I have a strange problem, concerning firefox and zooming. We have a #divMain, containing a #divPicture and a #divRight. The former is being floated left, and the later is floated right. So far, zooming in and out seem to work fine, but if either of them is given an 1 px border on the side between them (e.g:#divPicture->border-right or #divRight->border-left) zooming out messes up the page layout. Here is the CSS code being used: #divMain{width:700px;margin:0 auto;}#divPicture{width:548px;height:298px;background-image:url("index_main.png");background-repeat:no-repeat;border:1px solid #000;float:left;}#divMenu{width:149px;height:300px;background-image:url("index_right.png");background-repeat:no-repeat;float:right;border-right:1px solid #000;} Questions: what could cause this problem? Is there a way to create a page layout, using dimensions fixed in pixels, which is "invulnerable" to resizing, zooming and so on? Do you have any suggestions on how to achieve the same layout, but not having this problem?
  8. Yes, well the red background is only temporary, to make it easier to notice positioning flaws:) Indeed, this would solve the "graphical" aspect of this problem, but...I actually managed to find another solution, by putting a properly sized <div> in the place of the <img> and gave it the same image, as a background-image CSS property. This is good, because it not only results in what I want to be seen, but it is also flawlessly positioned, but...:)We still don't know why is it acting "wrong" if I use an <img>? Does my CSS or HTML knowledge lack something critical about the <img> tag, or what?
  9. Hello World!:)I have a very annoying problem here, and I don't know how to fix it.This here is the website:http://www.hgadmin.extra.hu/testing/index.htmlThe aim would be, to put the horizontal menu right under the #header image, without using position:relative/position:absolute. I am using FF3 under an Ubuntu Hardy Heron system, I din't know if that would be a problem, but because of this I couldn't see the page in IE6, so I don't know if this is a bug in FF or in my CSS skills:)I'd apprciate quick help, because I'm nearing the deadline :/note: I made some changes in the posted code, in comparison to the uploaded files, but I believe this should not be misleading in pointing out the source of my problem.HTML: <!DOCTYPE htmlPUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head> <link rel="stylesheet" type="text/css" href="style.css"></head><body><div id="divcenter"><img id="header" alt="" src="design/header.jpg" /> <div id="navigation"> <a href="#">Le-Be-Nő</a> <a href="#">Info/Jelentkezés</a> <a href="#">Időpontok</a> <a href="#">Vendégkönyv</a> <a href="#">Blog</a> </div></div></body></html> and CSS: body{ background-color:#000000; }#divcenter{ width:698px; border-left:solid 1px #666666; border-right:solid 1px #666666; background-color:#ff0000;}#header{ margin:0px;} #navigation { background-image:url('design/navbg.jpg'); } #navigation a { margin:0px; }
×
×
  • Create New...