Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by Shakazahn

  1. Weirdly enough, it's working fine now...I think the variable wasn't declared outside the function: var xmlDoc; And it was giving me null everytime I tried to use it inside the onreadystatechange function.Edit: Ah, I checked the responseHTML and I got the same error... and I'm getting the error again if I use responseXML as well, I guess it just worked because I changed that to responseText (which doesn't help me much since I need to loop through the objects inside the file)
  2. Hi,I'm trying to make a quick pre-defined layout builder for emails and such, and for that I'm using ajax.I'm storing some elements like:File Test.html <div> Testing...</div> And I'm using a Javascript code to load this file and display it on my main page. It works with .XML but I'd like it to work with .HTML files as well. function ajaxS(object, event) { xmlDoc = window.XMLHttpRequest ? new window.XMLHttpRequest() : new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.onreadystatechange = function() { if (xmlDoc.readyState == 4) { if(xmlDoc.status == 200) { alert(xmlDoc.response
  3. Shakazahn


    Yeah, I found out about that when I tried to register it... gonna remake it then, thanks.Another lesson learned the hard way
  4. Shakazahn


    That's what I'm trying to avoid... it is a HTML site with Flash and AJAX content (all the links are Flash + Javascript) so if I have to remove it I'll basically have to do it all over again...
  5. Shakazahn


    Hi,I don't know where this thread would fit since it's not really about any language in particular (maybe XML?) but more about the finishing touches of a site.I finished a site for a friend of mine and I'm trying to add it to the Google Search, but for some reason it says my site isn't indexed.One of the possible reasons they mention is that AJAX driven sites can't be tracked and thus won't be indexed, so they suggested that I make a Sitemap and send it to them.But the thing is, how do I create a Sitemap for an AJAX site?
  6. Worked perfectly, thanks!
  7. Shakazahn

    Text Fader

    I didn't notice anything wrong, worked fine here (IE 7 and FF 3), so it can be a browser issue.Can you be more specific with the problem?
  8. I've been trying to do a simple animation to simulate (only simulate, it doesn't check anything at all) a loading bar after the form is submited.Here's the code: <form action="myform.php" method="POST" name="form" id="form" onsubmit="return formcheck(this)">Name: <input type="text" style="width:200px;" name="name" id="name" /></form> And the script: function formcheck(form){ if(form.name.value == "") { alert("Please type your name"); form.name.focus(); return false; } else { var perc = 0; var inter; document.getElementById("body").innerHTML += "<div id=\"message\"
  9. Hum yep these 2 works but I can't use the borders like I want.Here's the site I'm setting up (incomplete, I've got some stuff up but I'm working on the design still): http://daniel.holywannapita.com/index.phpIt happened that I tried to show it to a friend of mine, who was using 800x600 (O_O) and things were just... huge, offscreen and weird (also, he was using IE 6 ugh). So I'm trying to set it so it can be viewed in any resolution, using %s.Currently I'm using tables to look like this but I want it to be div only, someone complained that it doesn't look good using tables on a site at all @_@
  10. Thanks for the reply but this isn't what I was trying to do, I mean, well, it is, but I don't want the "content" (body) having a fixed width.I use a 1440 wide monitor and I'm pretty much used to it, and since most viewers that come to the site use 1024x768, I'm trying to set up a resizable layout.But to get the resizable I'd need to use %s, but on a 1024x768 for example a 80% body and 20% menu looks good, but on my 1440 doesn't (the menu just gets... HUGE!), so I'm trying to set a fixed width for the menu only, and leave the body with a % of what's left.This is what I did:<table style="widt
  11. I've read some about tableless on the net and I really don't get the point, what's wrong with using tables for layout?Sites made with tables seem to work just as fine as without them, unless there's some hidden technical disavantage on using tables I don't see why shouldn't we use it for layout.Also, one question that I have is how would you format a page to look like this:The main point is that body must occupy all of the screen that's left after the menu, so I don't bother which resolution the viewer's using (the menu has a fixed width, while the body's width is everything else on screen - e
  12. I've made a comment box for my site and someone spammed a reaaaallllyyyy long line, and the comment box "broke".I'm using the sliding doors tech, with a 1600w long pic, but what's annoying is that no matter if I set a fixed width or not on FF the comment will just go out of the box (but the box will remain at max-width set) while on IE it'll break no matter what width/max-width I set.Is there a PHP command to force a linebreak from a SQL data?Quick Edit: I'm not asking about \n, but something that would help me prevent comments like that from "breaking" the box and messing the site's layoutQui
  13. I was browsing around and noticed some sites with comments have a resizable background image comment box, how do you do it?For example:The white box with round edges it's something like what I'm trying to do (a comics baloon) but I don't have a clue on how to (besides using multiple images with dif. sizes and maybe checking how many rows the comment has and then display the proper image? I think it's not, there should be something more flexible...).
  14. Shakazahn

    Xml Bug?

    Firefox's consistent with almost everything you try, you also know it'll probably work on any browser just like that except IE.IE's supposedly good, it makes the designer think of ways to work around it's bugs with creativity - alot of creativity. Unfortunately I can't do that, since I intended to use that to read how many childs that element had (and get it's names and some atts) and display on mouse over/out.Instead I loaded a hidden div with PHP and set it to show onmouse over events... not exactly what I wanted but it's working.
  15. Shakazahn

    Xml Bug?

    I just made a new XML file for testing purposes and if I type... <?xml etc?><root><main><firstchild></firstchild><secondchild></secondchild></main></root> ...it works perfectly fine.What I'm using to check is a body onLoad function(): startupload(){ document.getElementById('body').innerHTML = xmlFile.getElementsByTagsName('main')[0].childNodes[0].nodeName + "<br />"; document.getElementById('body').innerHTML += xmlFile.getElementsByTagsName('main')[0].childNodes[1].nodeName + "<br />";} And this displays firstchild / secon
  16. I was reading that post and found this: This is something that I'm trying to do, but is there a way to specify to PHP *where* to write the stuff I want?Right now I'm doing a multiple style script, that depending on the style chosen it'd write header, menu, body, etc (these are self contained php pages that'll write whatever's in my XML file) in the order I'd write them to be.But for this I'm having to write alot (and I mean *alot*) inside the HTML's body, is there any problem or better way to do this?
  17. I'm storing some text data in a XML file and I'm getting them with: foreach($xmlDoc->$_GET['page']->$_GET['cat']->children() as $number){ $numberPosts++; $contentXML[$numberPosts] = $number;} ...this so I can make a max. display per page by using the $contentXML[x] value.For some unknown reason, $xmlDoc->$_GET['page']->$_GET['cat'][x] didn't work even though page="main" and cat="news" while $xmlDoc->main->news[x] did.So I'm storing them on that array to display the desired results.What I want to ask is, I'm using the XML file to store a large amount of text data, does th
  18. How do I make a username/password validation that grants some access to a database? Or rather, what's the best approach to give someone access to a database?This is what I have so far: <html><head><title>PHP Form</title></head><script language="Javascript">function checkForm(){ var Name, Pass; with(window.document.form) { Name = name; Pass = pass; } if(trim(Pass.value) == "") { alert('Insert a valid password.'); pass.focus(); return false; } else if (trim(Name.value) == "") { alert('Insert a valid username.'); name.focus(); return false; } else {
  19. Thanks, that's what I was looking for, though I don't know how to use MySQL so I'm sticking with XML.This is what I'm trying to do: <a href="index.php?page=main">Main</a><div id="siteMainBody"><?phpswitch $_GET['page']{case main: echo xml->main; //loading from the xml into the body break;}?></div> But I'm getting a "Notice: Use of undefined constant principal - assumed 'main' in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\index.php on line 28" for every case...From what I've read it's "just" a notice and shouldn't prevent the site from runn
  20. While I'm at this, another question:Can I make a website with hyperlinks linking to the page itself, but sending some params that I could use the $_GET to display the according content on a XML file?Instead of having multiple files for each page on a website I'd have one with a PHP function that checks the args sent by the link and it would display a different content.If it's possible, any tips on how should I start?
  21. I've been working on a site with Javascript for a while, but I'm trying to learn PHP at the moment and some doubts came up.1. Can I use PHP for event handling instead of Javascript? Even though it's server side script, is there a way to work around with XML on Request?Even if I manage this, wouldn't this overwork the server with timed functions?2. What I really want is to get rid of that message "Do you want to enable ActiveX..." that IE pops up everytime. It's not a big deal, but I'd like to know if I can get rid of it using server-sided scripts instead of my usual JS.What I'm using JS mostly
  22. Argh, figured it... document.getElementById('myBody').innerHTML = xmlDoc.getElementsByTagName('main')[0].childNodes[x].childNodes[0].nodeValue; Didn't thought I had to call the child of the child to get it's content...
  23. Hello,I was following w3 tutorial and while trying some examples I got to this: document.getElementById('myBody').innerHTML = xmlDoc.getElementsByTagName('main')[0].childNodes[0].nodeValue; ...which works really fine, but I can't get anything else than that.From the tutorial: * xmlDoc - the XML DOM object created by the parser. * getElementsByTagName("title")[0] - the first <title> element * childNodes[0] - the first child of the <title> element (the text node) * nodeValue - the value of the node (the text itself)So I tried using childNodes[1] to get my 1st subelemen
  24. I don't know what this jquery is but I'm doing something like that for a site I'm working on, here's the code: <img src="imagens/foto1th.jpg" class="imagens" onclick="openImage(this, this.lastsrc, this.state, 'picture1.jpg')">...<script>function openImage(object, lastsource, state, source){ if(state) { object.state = state; } else { object.state = false; } if(object.state == false) { object.lastsrc = object.src; object.src = "images/" + source; object.state = true; } else { object.src = lastsource; object.state = false; }}</script> Adjust according to your needs
  • Create New...