Jump to content

lastlifelost

Members
  • Content Count

    125
  • Joined

  • Last visited

Everything posted by lastlifelost

  1. That did it! I knew it had to be something easy I was missing. Thanks to you all for looking my code over!
  2. Fixed the 404, thanks for pointing that out. This still isn't working for me. I'm running FF4.0.1. When I go to the blog page and click the "See who's talking & Leave Nina a comment!" link under any of the blog posts, nothing happens. You're not having any issues here? I cannot for the life of me figure out why this isn't working. I even checked to make sure that I have Javascript turned on, just in case! What am I missing here?What should be happening is when the "See who's..." link is clicked all of the comments and the comment form should slide into view underneath the blog post. This works in IE, O, Ch, and S. Only FF is giving me trouble. Is there something wrong with my FF install or is the a reproducable issue?
  3. I'm working with a content toggle to reveal the comments section of a blog post. It works everywhere except FF. I can't see the error, I don't even know where to start tracing it from. My guess is that the anchor link is trying to refresh the page. Can anyone else see what's going on? The pertinent code is below, as well as a link to the live blog. <script type="text/javascript"> function toggleElement(id) { $(id).toggle('slow'); return false; } </script> <a href="#comments" class="clear-floats italic" onclick="toggleElement(commentsFor53)">See who's talking & Leave Nina a comment!</a> <section id="commentsFor53" style="display:none"> <!-- this article's comments --> ... </section> live site: Proud Flower Blog
  4. I'm curious why this was removed from the spec and what, if anything, is replacing it. The closest thing I could find was the details tag, but that didn't seem right.
  5. OK, that helps. I was having a mini-breakdown thinking that I wasn't making my code properly semantic. I know that it won't kill the page, but I definitely want to be working toward the most current standards. I like your definition of a section as a cluster or paragraphs or content under a single heading. That really helped to clear things up for me.
  6. Divs and Sections: they're essentially interchangeable, right? I'm coding my first HTML5 page and I'm wondering if there's a time that one is more semantically correct than the other. For instance, would the main content for my site belong in a section, or should I use a div like I used to? Also, would the subsections in a page's content section be sections, divs or articles? The HTML5 spec suggests that an article should be a standalone content block - something that could be presented independently of the rest of the content. Does this mean that the main content of my page should be an article and the inner portions should be sections? I think this is getting closer to the semantics I'd expect to see. What are the thoughts of the pros on this one?
  7. It's the last part that made me wonder if I'm doing something wrong in the PHP and .txt data file. Take a look at the scripts below. Is there something that I'm missing here?XML tags contained in .txt file, these are updated by the following php when a user posts. This is more or less a tag database.<name>Chrome Test</name><message>Chrome</message><name>Firefox Test</name><message>Firefox</message><name>Opera Test</name><message>Opera</message><name>Safari Test</name><message>Safari</message><name>IE Test</name><message>IE</message><name>lo</name><message>lorem ipsam</message> This is the PHP that updates posts.txt and returns the updated XML. This script is also called when the page loads to fill in the existing posts. <?php $filename = 'posts.txt'; if ($_GET['name']) { $handle = fopen($filename,'a'); $name = htmlentities($_GET['name']); $message = htmlentities($_GET['message']); $content = "\n<name>".$name."</name>\n\n<message>".$message."</message>\n"; fwrite($handle, $content); fclose($handle); } header("Content-type: text/xml"); echo '<?xml version="1.0" encoding="UTF-8"?>'; echo "\n<posts xml:lang=\"EN\">\n"; readfile ($filename); echo "\n\n</posts>\n";?>
  8. -- Bumping thread --I'm still trying to figured out what's going on. Are there any other suggestions about what might be going wrong? Code is listed above. Why would this be failing in IE when everything seems to be going through just fine?
  9. I do have IE9 installed, and I have been using the console. Unfortunately, it hasn't been throwing me any errors. The page did throw a single error when the alert stopped showing up: SCRIPT438: Object doesn't support property or method 'overrideMimeType'. I've commented out the overrideMimeType line for now and the alert is popping up again. I don't know what else to look for, though. The script isn't generating errors - at least none that the console is showing. What should my next step be?
  10. Added - borked the IE more, actually. Now it doesn't return anything (visibly, at least). The alert doesn't show in IE anymore either. It this possibly because we're overriding the mime type now and IE's not registering responseText as a result?Everything is still working in the other browsers.Updated JS://compact xh script ////////////////////////////////////////////////////function makeRequest() { // IE7+, Chrome, Safari, Firefox, Opera if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else { // IE5, IE6 req = new ActiveXObject("Microsoft.XMLHTTP"); } return req; } var xhrSubmitPost = makeRequest();// end compact xhrscript ////////////////////////////////////////////// //submitPost //////////////////////////////////////////////////////////function submitPost() { var name = validField("name",true); var message = validField("message",true); // Form verifier function.function validField(field,required) { //Error Messages: add or modify as needed. var errors = { name : "Name is required", message : "Message is required" };/***************************************************************** ** DO NOT EDIT BELOW THIS LINE ** *****************************************************************/ //loads email fields for verifying Field = "#" + field; //creates jQuery-able id vField = $(Field); //handles input fields vStr = vField.val(); //grabs info to verify from input fields vStr = vStr.replace(/^\s+|\s+$/g, ''); //removes leading/trailing spaces //Throws errors for invalid input fields if ( vStr === null || vStr === "" && required === true) { if (!$("span.error:contains("+errors[field]+")").length) { vField.after("<span class='error'>"+errors[field]+"</span>"); } vStr = false; } else { $(".error").remove(":contains('"+errors[field]+"')"); } return vStr; //returns error code or valid info for mailing variables } if (name !== false && message !== false) { myQuery = "?name=" + encodeURIComponent(name) + "&message=" + encodeURIComponent(message); doPosts(myQuery); }} // end submitPost //////////////////////////////////////////////////// function doPosts(myQuery) { myUrl = "postRunner.php"; myQuery = (typeof myQuery == 'undefined') ? "" :myQuery; xhrSubmitPost.open("GET", myUrl+myQuery, true); //xhrSubmitPost.setRequestHeader("Accept", "text/xml"); xhrSubmitPost.overrideMimeType('text/xml'); xhrSubmitPost.send(); xhrSubmitPost.onreadystatechange = useHttpResponse; function useHttpResponse() { if (xhrSubmitPost.readyState == 4 && xhrSubmitPost.status == 200) { existingPosts = (typeof discLength != 'undefined' && discLength>=0 ) ? discLength + 1 : 0; discLength = xhrSubmitPost.responseXML.getElementsByTagName("name").length-1; alert ("xhrSubmitPost.responseText: \n" + xhrSubmitPost.responseText); while (existingPosts <= discLength) { $("#posts").prepend("<div>"+ xhrSubmitPost.responseXML.getElementsByTagName("name")[existingPosts].textContent +"\n<br>\n" + xhrSubmitPost.responseXML.getElementsByTagName("message")[existingPosts].textContent+"\n</div>"); existingPosts++; } existingPosts++; //prevents duplicating the second to last post on update } }}
  11. Guy,I fixed myQuery as suggested. No dice. I used the alert(xhrSubmitPost.responseText) to find out that the data is showing up, but is not being read as XML.Here's a link to the active page, with the alert still turned on:http://seanosterhout.com/programmingfortheinternet/forum.phpI feel like we're getting closer, at least!
  12. Thanks for the response, Dad! I reversed the order of calling the makeRequest() function and added the setRequestHeader() line right after .open(). IE is still throwing the bogus data, though. What else can I test to see what's going on?
  13. I'm trying to create a discussion board/comments thread. I've got it working in FF, Chrome, Safari and Opera, but IE keeps telling me the returned data is undefined. It's also not letting me send data to the server, or, if it is, it's not getting added to the posts.txt file.Here's what I'm working with right now:JavaScript //compact xh script ////////////////////////////////////////////////////var xhrSubmitPost = makeRequest();function makeRequest() { // IE7+, Chrome, Safari, Firefox, Opera if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else { // IE5, IE6 req = new ActiveXObject("Microsoft.XMLHTTP"); } return req; } // end compact xhrscript ////////////////////////////////////////////// //submitPost //////////////////////////////////////////////////////////function submitPost() { var name = validField("name",true); var message = validField("message",true); alert (name + " " +message); // Form verifier function.function validField(field,required) { //Error Messages: add or modify as needed. var errors = { name : "Name is required", message : "Message is required" };/***************************************************************** ** DO NOT EDIT BELOW THIS LINE ** *****************************************************************/ //loads email fields for verifying Field = "#" + field; //creates jQuery-able id vField = $(Field); //handles input fields vStr = vField.val(); //grabs info to verify from input fields vStr = vStr.replace(/^\s+|\s+$/g, ''); //removes leading/trailing spaces alert (vStr);// alert (errorExists); //Throws errors for invalid input fields if ( vStr === null || vStr === "" && required === true) { if (!$("span.error:contains("+errors[field]+")").length) { vField.after("<span class='error'>"+errors[field]+"</span>"); } vStr = false; } else { $(".error").remove(":contains('"+errors[field]+"')"); } return vStr; //returns error code or valid info for mailing variables } if (name !== false && message !== false) { myQuery = "?name=" + name + "&message=" + message; doPosts(myQuery); }} // end submitPost //////////////////////////////////////////////////// function doPosts(myQuery) { myUrl = "postRunner.php"; myQuery = (typeof myQuery == 'undefined') ? "" :myQuery; xhrSubmitPost.open("GET", myUrl+myQuery, true); xhrSubmitPost.onreadystatechange = useHttpResponse; xhrSubmitPost.send(); function useHttpResponse() { if (xhrSubmitPost.readyState == 4 && xhrSubmitPost.status == 200) { existingPosts = (typeof discLength != 'undefined' && discLength>=0 ) ? discLength + 1 : 0; discLength = xhrSubmitPost.responseXML.getElementsByTagName("name").length-1; while (existingPosts <= discLength) { $("#posts").prepend("<div>"+xhrSubmitPost.responseXML.getElementsByTagName("name")[existingPosts].textContent + "\n<br>\n" + xhrSubmitPost.responseXML.getElementsByTagName("message")[existingPosts].textContent+"\n</div>"); existingPosts++; } existingPosts++; } }} PHP: <?php $filename = 'posts.txt'; if ($_GET['name']) { $handle = fopen($filename,'a'); $name = htmlentities($_GET['name']); $message = htmlentities($_GET['message']); $content = "\n<name>".$name."</name>\n\n<message>".$message."</message>\n"; fwrite($handle, $content); fclose($handle); } header("Content-type: text/xml"); echo '<?xml version="1.0" encoding="UTF-8"?>'; echo "\n<posts xml:lang=\"EN\">\n"; readfile ($filename); echo "\n\n</posts>\n";?> What have I missed?EDIT:: Looks like the posting process is working now, but the returned data is still coming up undefined.
  14. Nevermind. The issue seems to have been fixed, though I'm not sure how. Maybe the server needed to rest for a while?
  15. I'm using the following code to reset a contact form. It's working fine to remove the entered data, but it's not resetting the HTML the way I think it should function selectiveReload(section, url) { //contrstucts the jQuery-compliant id sectionId = "#" + section; //OPTIONAL: determines the page to grab new content from. //If left blank, will load content from the current page url = (url === undefined) ? document.location : url; //determines the original element's tag name for use with inserting the new content tag = ($(sectionId).get(0).tagName); tag = '<'+tag+'><\/'+tag+'>'; //loads and inserts the new content content = $(sectionId).load(url + ' ' + sectionId).html(); content = $(tag).attr("id",section).html(content); $(sectionId).replaceWith(content);} What's happening is when a bad email address or blank line is found, another script will flag it, show an error message and add some styling. The reset script above should be grabbing the whole form fresh from the server and replacing that content block in the HTML, thus removing the styling and the data entered (if any). An example can be seen here: http://stweb.ccv.edu/CIS-2140-VO01-V11SP/s...ments/9test.php. Am I missing something important or am I asking for something that can't be done in this way?
  16. I can't be dine with just HTML, but if you're OK with javascript, try this: <a href="#" onClick="history.go(-1)">Back</a> Simple back button that will bring you back to the last page you were on.
  17. Woke up this morning with the solution in mind. Modified the replace line as follows: .replace(/[<>\t\n]/g, function(m) { return {'<':'<','>':'>','\t':' ','\n':'<br>'}[m]}) It now replaces \n with <br>, fixing the issue without needing to split the string up and reassemble. This fixes the problem I was having in IE.
  18. The issue is coming from webkit's default style sheet. The anchor tags have a text-decoration:underline applied by default. Try adding this to your stylesheet: .home, .forum, .profile, .apply{text-decoration: none;} or better yet: div.buttons > a { text-decoration:none;} That should fix your issue.
  19. I'll try playing with that option. I feel like there must be some easier answer though. Anybody have other suggestions for what I'm (or what IE is) doing wrong?
  20. Tried it, that renders just fine. I had a feeling that it was something to do with line carriage returns, but couldn't figure out what to do about it. Is there a way to target IE only then pick up the script line by line and re-render it with each line ending in a \n or even hard-coding in a <br> on each line maybe?
  21. Thanks for catching that. It was a hang around from an earlier version of the script. I'm not sure why the comma was there, really. Fixed that: $(function() { $("<pre />", { "html": $("#jsMethod") .html() .replace(/[<>\t]/g, function(m) { return {'<':'<','>':'>','\t':' '}[m]}) }).appendTo("#jsMethodSource"); }); http://stweb.ccv.edu/CIS-2140-VO01-V11SP/s...nments/test.htmIt doesn't look like that was the hang up in IE, though. Am I missing something else in the code?
  22. I'm trying to make the following code display the source of a specific block. It works in mosts browsers, but IE is rendering everything on a single line. I can't figure out what I'm missing to make it show properly. Do any of you good fellows have some suggestions? $(function() { $("<pre />", { "html": $("#jsMethod") .html() .replace(/[<>\t]/g, function(m) { return {'<':'<','>':'>','\t':' '}[m]}) + '\n</html>', }).appendTo("#jsMethodSource"); }); http://stweb.ccv.edu/CIS-2140-VO01-V11SP/s...nments/test.htm
  23. a:visited { font-style:italic;} Simple bit of code I'm trying to use on this project that doesn't seem to be working. Works fine in IE and others, but Chrome isn't playing nice. What am I missing here?
  24. Damn those pesky closing tags! I recently had a similar issue where I forgot to close a tag and magically "lost" half a page's worth of content. Must have been staring at the screen too long to see the issue. Wound up going over the code line by line before I found the problem. Wow did I feel stupid...Long story short: it happens! Glad you got it worked out.
  25. Are you having issues in a specific browser? I tested in IE and Chrome with no issues. BTW, your link is broken. Looks like a typo in the URL. It's supposed to be newyorkrocknroll.com, right?
×
×
  • Create New...