Andy11548 Posted July 8, 2011 Share Posted July 8, 2011 Right, I have a script that if I have; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> that part in my site, the script doesn't work. If I remove it, it does. $(document).ready(function() { $('#feedback').load('check.php').show(); $('#username_input').keyup(function() { $.post('check.php', { username: form.username.value }, function(result) { $('#feedback').html(result).show(); }); }); }); If anyone knows why, it would be a great help. Thanks, Andy. Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/ Share on other sites More sharing options...
Adam Posted July 8, 2011 Share Posted July 8, 2011 No suggestions come to mind. A transitional doctype is a lot more forgiving too, so I doubt it's an issue with the mark-up. Do you have this online for us to look at? Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240013 Share on other sites More sharing options...
Andy11548 Posted July 8, 2011 Author Share Posted July 8, 2011 Nope, it's on my localhost. All my other JS works, its just this one that doesn't and it's really confusing me, I really don't see why adding the doctype would stop the script working :S. I got teamviewer if that'd do? Thanks, Andy. Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240084 Share on other sites More sharing options...
AyKay47 Posted July 8, 2011 Share Posted July 8, 2011 make sure that your document is valid XHTML Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240092 Share on other sites More sharing options...
Andy11548 Posted July 8, 2011 Author Share Posted July 8, 2011 I put the script in a seperate file and closed every tag etc, and it still didn't working :S. Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240097 Share on other sites More sharing options...
AyKay47 Posted July 8, 2011 Share Posted July 8, 2011 have you run it through the w3c validator? Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240100 Share on other sites More sharing options...
Andy11548 Posted July 8, 2011 Author Share Posted July 8, 2011 Right, I just done that, and that didn't fix it either. I found that if I remove the "html" part from <!DOCTYPE html, then it works, just fucks my HTML code up then. I don't know how to win in this situation lol. Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240145 Share on other sites More sharing options...
Pikachu2000 Posted July 8, 2011 Share Posted July 8, 2011 The validator isn't supposed to fix anything. It just tells you what the errors are, so you can fix them. How many validation errors were there? Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240147 Share on other sites More sharing options...
AyKay47 Posted July 8, 2011 Share Posted July 8, 2011 you can try to put the browser to "quirks" mode, while still maintaining the reminder of the level of XHTML you are writing..try writing the doctype like this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> //remove URL Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240148 Share on other sites More sharing options...
KevinM1 Posted July 8, 2011 Share Posted July 8, 2011 you can try to put the browser to "quirks" mode, while still maintaining the reminder of the level of XHTML you are writing..try writing the doctype like this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"> //remove URL Yes, and then screw up his box model and all block elements on the page.... @OP - have you tried running it with Firebug? Have you tried just a simple HTML 5 doctype: <!doctype html> ? Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240155 Share on other sites More sharing options...
Andy11548 Posted July 8, 2011 Author Share Posted July 8, 2011 Yeah I tried that. And yes, the validator does fix your errors if you ask it to and the only error I had was because I didn't have <title></title> in my head tags. Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240283 Share on other sites More sharing options...
Pikachu2000 Posted July 8, 2011 Share Posted July 8, 2011 You would still have to copy and paste the cleaned up code into the file, save it and upload it. So no, it doesn't fix errors for you. Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240285 Share on other sites More sharing options...
Andy11548 Posted July 9, 2011 Author Share Posted July 9, 2011 Yeah, I know that, which is what I done, but it hasn't solved the problem. Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240371 Share on other sites More sharing options...
Andy11548 Posted July 9, 2011 Author Share Posted July 9, 2011 Nevermind, I give up with this, I do have a lazy mind when I've been writing code for hours, so I'm starting from fresh again, making sure I take my time and type everything correctly, run everything through validation before I continue and yeah. I'll see if I get this problem still once I've compleatly re-wrote my pages. Thanks for the help, Andy. Quote Link to comment https://forums.phpfreaks.com/topic/241397-weird-problem/#findComment-1240401 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.