• Web Development Questions That Don't Need Their Own Thread v2
    3,079 replies, posted
[QUOTE=pinecleandog;31836217]hey guys ok well im stuck with this, im making a row of buttons on a table row, all the buttons use the <a> tag, and use a custom javascript, but i want to know if there is a way of preventing these gaps and litle purple dashes from forming between each button. all borers on the table and images are set to "0" [url]http://dl.dropbox.com/u/33714868/site/index.html[/url][/QUOTE] There is no need to use javascript to make an interactive menu, use css. Center tags are depreciated meaning they shouldn't be used and the style tag belongs inside the head tag.
[QUOTE=slayer20;31834413]Hi. So I'm working on a school project where I have to make a website that's about me. I'm currently focusing on my Main page.[/QUOTE] [quote]I do have to have a background sound[/quote] [quote]And another thing, out teacher doesn't want us to use HTML code that's "deprecated".[/quote] [img]http://costeira.com/upl/uploads/1309326740417.jpg[/img] Although, even though your teacher is teaching you HTML incorrectly, you're already doing better than most beginners I see, not having a html/head/body tag and their appropriate closing tags, etc. You're not even using Comic Sans! Personally, I think your design is pretty interesting. Also, it's better to have a [url=http://www.htmldog.com/reference/htmltags/style/]<style> tag in the head[/url] rather than in all tags in the body scattered about. Tizag.com also has really nice [url=http://tizag.com/htmlT/]HTML tutorials[/url] and [url=http://www.tizag.com/htmlT/reference/htmlreference.php]a reference[/url] that shows all the tags (and if they're deprecated or not, too) Edit: Also, you don't have a DOCTYPE. It goes before the <html>, and it's almost always the first line in a page. Personally, I (and I think [URL="http://html5boilerplate.com/"]that[/URL] [URL="http://www.google.com"]most[/URL] [URL="http://www.youtube.com/"]people[/URL]) just use "<!DOCTYPE HTML>". Otherwise, (specifically) IE will do everything more wrong than usual.
[QUOTE=cas97;31837569]Edit: Also, you don't have a DOCTYPE. It goes before the <html>, and it's almost always the first line in a page. Personally, I (and I think [URL="http://html5boilerplate.com/"]that[/URL] [URL="http://www.google.com"]most[/URL] [URL="http://www.youtube.com/"]people[/URL]) just use "<!DOCTYPE HTML>". Otherwise, (specifically) IE will do everything more wrong than usual.[/QUOTE] Don't all browsers go into quirks mode without a doctype?
[QUOTE=a2h;31837875]Don't all browsers go into quirks mode without a doctype?[/QUOTE] From my observation, Chrome/Safari/Opera/Firefox all don't fallback to quirks mode. A good example of this was with Facepunch's chat which disappeared only recently. Every browser displayed the page without error, except IE. The only issue was the neglected doctype.
Gecko and WebKit have a quirks mode, some are just less quirky than others (And some people end up thinking the behavior is normal and depending on it, etc.) Edit: But there's no downside to including a doctype, so never not include it.
[QUOTE=deadeye536;31838084]From my observation, Chrome/Safari/Opera/Firefox all don't fallback to quirks mode. A good example of this was with Facepunch's chat which disappeared only recently. Every browser displayed the page without error, except IE. The only issue was the neglected doctype.[/QUOTE] yet i bet garry would've blamed ie and said it was a terrible browser
[QUOTE=moonage;31839346]yet i bet garry would've blamed ie and said it was a terrible browser[/QUOTE] [QUOTE=moonage;31839346]blamed ie and said it was a terrible browser[/QUOTE] [QUOTE=moonage;31839346]terrible browser[/QUOTE] It is. [editline]20th August 2011[/editline] Well, IE9 is okay, but anything prior to that makes me cry blood.
[QUOTE=EJay;31839991]It is. [editline]20th August 2011[/editline] Well, IE9 is okay, but anything prior to that makes me cry blood.[/QUOTE] the point your head
[QUOTE=moonage;31840575]the point your head[/QUOTE] I got the point, obviously.
Just started doing web design through a class in school. I realize I know next to nothing about web design, but what's the best text editor for it? Right now I'm using dreamweaver just because that's what the curriculum includes, and it has a pretty good help system, but when I outgrow that, what should I move to? I know Dreamweaver is not a respected program.
[QUOTE=ManningQB18;31852832]Just started doing web design through a class in school. I realize I know next to nothing about web design, but what's the best text editor for it? Right now I'm using dreamweaver just because that's what the curriculum includes, and it has a pretty good help system, but when I outgrow that, what should I move to? I know Dreamweaver is not a respected program.[/QUOTE] i use notepad++ on windows and gedit on linux i've heard sublime is pretty good
I absolutely love Notepad2, I'm using a modded version with code folding which is quite useful. It can run from a USB thumb drive so you can take it anywhere.
[QUOTE=ManningQB18;31852832]Just started doing web design through a class in school. I realize I know next to nothing about web design, but what's the best text editor for it? Right now I'm using dreamweaver just because that's what the curriculum includes, and it has a pretty good help system, but when I outgrow that, what should I move to? I know Dreamweaver is not a respected program.[/QUOTE] Dreamweaver's code view is very nice, but its design view is often terribly wrong. An alternative I would use if I didn't have it would be Notepad++. On Mac, I hear that Coda is good.
Ok guys, i have a hard one that im stuck on, right now im bypassing MySQL for this so you'll have to excuse me. Ok so what i want to do is output a line of text inputted by the user in a simple html text form. This is the html code: [QUOTE]<form name="Login"> <p class="copyright">Username: <input type="text" name="username" value="username" /> Password: <input type="password" name="password" value="password" var="password"/> <input type="button" name="confirm1" value="Enter" onclick="login()" /></p> </form>[/QUOTE] But i want this input to be read by javascripted and outputted as an alert() this is the current javascript: [QUOTE]var user = document.Login.username.(?); function login() { alert("The username is is "+user); }[/QUOTE] But i dont know what object property of the text form it is to get the data of the input, so basically, what do i put in the (?) ?
[code]var user = document.getElementById.Login.username.value; function login() { alert('The username is ' + user); }[/code] Should do it. [editline]Now[/editline] Nope.
[QUOTE=EJay;31857069][code]var user = document.getElementById.Login.username.value; function login() { alert('The username is ' + user); }[/code] Should do it.[/QUOTE] Arght didn't work :s The function is deffinatly correct but the line that gets the information from the form is what hurts
Yeah that'd be because your username field doesn't have an 'id' attribute. [editline]21st August 2011[/editline] [code]<form name="login"> <p class="copyright">Username: <input id='username' name='username' placeholder='Username' type='text'> Password: <input id='password' name='password' placeholder='Password' type='password'> <input type="button" name="confirm1" value="Enter" onclick="login()" /></p> </form>[/code] Then your JS code: [code]var user = document.getElementById.username.value; function login() { alert('The username is ' + user); }[/code]
[QUOTE=EJay;31857131]Yeah that'd be because your username field doesn't have an 'id' attribute. [editline]21st August 2011[/editline] [code]<form name="login"> <p class="copyright">Username: <input id='username' name='username' placeholder='Username' type='text'> Password: <input id='password' name='password' placeholder='Password' type='password'> <input type="button" name="confirm1" value="Enter" onclick="login()" /></p> </form>[/code] Then your JS code: [code]var user = document.getElementById.username.value; function login() { alert('The username is ' + user); }[/code][/QUOTE] okay... so i changed everything to that, and nothing happens.. is that because its mising a ".login" in the Js or?..
getElementById takes a string which is the ID of the element you want, it's not an enumerated property or magic.
[QUOTE=TheDecryptor;31857216]getElementById takes a string which is the ID of the element you want, it's not an enumerated property or magic.[/QUOTE] ok update: everything functions but it still shows variable "user" as a "undefined" value
Is there any sort of code completion plugin for Sublime Text?
[QUOTE=Alcapwne;31858256]Is there any sort of code completion plugin for Sublime Text?[/QUOTE] There is already one implemented as far as I'm aware, "ctrl + space" is the keys I believe.
Pressing Tab also works. Try writing "p" and pressing tab, it will become <p></p>.
[QUOTE=Crhem van der B;31859773]Pressing Tab also works. Try writing "p" and pressing tab, it will become <p></p>.[/QUOTE] [QUOTE=Chuushajou;31859171]There is already one implemented as far as I'm aware, "ctrl + space" is the keys I believe.[/QUOTE] Ah okay, thanks :)
[QUOTE=EJay;31857131]Yeah that'd be because your username field doesn't have an 'id' attribute. [editline]21st August 2011[/editline] [code]<form name="login"> <p class="copyright">Username: <input id='username' name='username' placeholder='Username' type='text'> Password: <input id='password' name='password' placeholder='Password' type='password'> <input type="button" name="confirm1" value="Enter" onclick="login()" /></p> </form>[/code] Then your JS code: [code]var user = document.getElementById.username.value; function login() { alert('The username is ' + user); }[/code][/QUOTE] What the fuck was I doing? That document.getElementById bit should be: [code]document.getElementById('username').value[/code] Apologies, I'm not sure what the hell was going through my head.
[QUOTE=EJay;31859884]What the fuck was I doing? That document.getElementById bit should be: [code]document.getElementById('username').value[/code] Apologies, I'm not sure what the hell was going through my head.[/QUOTE] still shows up as undefined but :( [editline]21st August 2011[/editline] Javascript: [QUOTE]var user = document.getElementById('username').value; function login() { alert('The username is ' + user); }[/QUOTE] Forms: [QUOTE]<form name="logininfo" > <p class="copyright">Username: <input id='username' name='username' placeholder='Username' type='text'> Password: <input id='password' name='password' placeholder='Password' type='password'> <input type="button" name="confirm1" value="Enter" onclick="login()" /></p> </form> </form>[/QUOTE] Am i going wrong anywhere?
[code] function login() { var user = document.getElementById('username').value; alert('The username is ' + user); }[/code]
[QUOTE=Skorpy;31860507][code] function login() { var user = document.getElementById('username').value; alert('The username is ' + user); }[/code][/QUOTE] [b]Edit:[/b] Alright it does matter here.
[QUOTE=Skorpy;31860507][code] function login() { var user = document.getElementById('username').value; alert('The username is ' + user); }[/code][/QUOTE] There we go! that worked! thanks man great help <3 but i honestly didn't think setting it as a local variable would make a difference.
Why it matters, is that we call the function login when we click submit. We get the value after we have written in the input field. It could have been a global variable, that wouldn't have mattered.
Sorry, you need to Log In to post a reply to this thread.