Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. The URL for the XMLHttpRequest needs to be for the same server on which the script is running. So, if your page is running on http://someserver/ then the URL needs to be relative to that. The URL does not need to be publicly accessible. If you aren't getting any errors when you send the XMLHttpRequest then this probably isn't an issue.What might be happening is that the data that is being posted isn't formatted properly. It looks like you are simply sending the XML file. You might try sending the data in a key/value pair, something like this: xmlhttp.send("xml=" + xmlData.xml); I ran into a problem like this, and sending the data as "xml=<myxmldata>" rather than "<myxmldata>" seemed to please the server.
  2. jesh

    Firefox CSS problem

    Sorry to jump in here, but the problem seems to be that the server thinks the file is of type application/octet-stream (i.e. a binary file) rather than a text file. If you've saved the contents of the file with Notepad, as aspnetguy suggested, then the file on your computer should be a text file. Perhaps, if the server is running Unix/Linux rather than Windows, there may be a conflict happening when you are transferring the file over FTP. You might check for a setting in your FTP program that allows you to transfer files over as text as opposed to binary (or vice-versa).You might also try saving the file, using Notepad again, as a txt file rather than a css file. Then, once the file is saved, change the extension from .txt to .css. Alternatively, you might try saving the file as .txt and uploading that to your server and changing the reference to the stylesheet to this: <link rel="stylesheet" type="text/css" href="layout4setup.txt" /> These are just ideas to get the server thinking that the file is a text file rather than a binary file. Most likely, however, the problem is occuring in the FTP transaction as I mentioned above.
  3. Also take notice of this part of your error message: "File or assembly name DreamweaverCtrls, or one of its dependencies, was not found.". It looks like you're missing a reference somewhere. As I've never used Dreamweaver, I'm afraid I won't be of any more help.Notice how the LOG lines are telling you that .NET is looking for DreamweaverCtrls.DLL but can't find it in a number of directories? Find that file, place it in one of those directories, and your problem may go away.
  4. Maybe something like this? <div id="a1" class="slides"></div><div id="a2" class="slides"></div><div id="a3" class="slides"></div> function init(){ var divs = document.getElementsByTagName("div"); for(var i = 0; i < divs.length; i++) { if(divs[i].className == "slides") { slides.push(divs[i]); } }}window.onload = init;
  5. jesh

    Textarea - add text

    Or something like this? function mywrite(somestring){ document.getElementById('txt1').value = somestring;} <form action="" method="get"><input type="button" id="button1" value="Cats" onclick="mywrite('This is some message for cats!')" /><input type="button" id="button2" value="Dogs" onclick="mywrite('This is some message for dogs!')" /><input type="button" id="button3" value="Fish" onclick="mywrite('This is some message for fish!')" /><textarea id="txt1" name="txt1"></textarea><input type="reset" value="Clear" /></form>
  6. Yeah, it looks like that function is trying to access an element with an ID of "TextArea1". So far, in the code that you posted, there are no elements with an ID of "TextArea1". You are probably missing something like this: <textarea id="TextArea1"></textarea>
  7. My guess is that somewhere in that "FP_setTextFieldText" function there is code that is trying to access an element with an id of "TextArea1" but that there isn't an element on your page with an id of "TextArea1".I'm sure we'd have to see the code to be sure though.
  8. Preloading images in javascript is pretty straight forward: <html><head><style type="text/css">#content { display: none; }</style><script type="text/javascript">funciton showImages(){ document.getElementById("content").style.display = "block"; document.getElementById("screen").style.display = "none";}window.onload = showImages;</script></head><body><div id="content"> <img src="/images/image1.jpg" /> <img src="/images/image2.jpg" /> <img src="/images/image3.jpg" /> <img src="/images/image4.jpg" /></div><div id="screen"> Please wait while the page loads...</div></body></html> Rather than hiding the screen and showing the content, you could redirect the user to a different page if you wanted: funciton showImages(){ location.href = "/page2.html";} EDIT: I must be a slower typer than ste!
  9. I'll admit that it happens to me. I can't tell you how many times I stick a semi-colon - ; - at the end of a line of VB. It drives me crazy. Also, when switching from C# to javascript, I'll occasionally try to use "foreach" rather than "for" and I'll also declare the variables as "string", "int", "float", "bool", etc. rather than "var". It usually only makes me stumble for about 2 seconds and then I'm past it, but the problem is there.
  10. I think the navigation could use some work. I like the style well enough; the part that gets me is that the navigation stays put when I click on any of the links except the forums link. When you click on forums, the navigation disappears and there's no apparently easy way to get back. I would suggest either removing the "Forums" link from the navigation and linking to it elsewhere or figuring out how to add the navigation to the forums pages as well.
  11. Any time you are working on selling products online, it's probably best to use a server-side solution for that. The reason I say this is that if you store the data for a particular product in an XML file and then build a shopping cart solely on the client-side, someone who is less than honest can modify the request so that the shopping cart is full of $100 items with $1 prices.While you don't necessarily need a database to do this, I would still recommend that the prices come from the server rather than client-side through javascript and that when the form is submitted (i.e. checkout), the prices are validated against the server using PHP, ASP.NET, etc.I apologize if what I've said above is something that you already know. :)As for processing an XML file, the only way I've had consistent success was to use the XML DOM. The tutorial here has been invaluable to me: http://www.w3schools.com/dom/default.asp.P.S. Nice effect with the drag and drop!
  12. There you go, you could include a captcha control as well! The features just keep piling on!
  13. While it sounds like you are leaning towards not requiring people to log into your site in order to leave comments, you'll probably still want to set up a user management system (at least for experience) where you are the only user. That way, you have to log into the site in order to upload new photos, comments, etc.
  14. Another great site for articles regarding CSS based navigation is http://www.alistapart.com/.
  15. If you had the content that you wanted to remain throughout the site (without reloading) in one div, perhaps you could use AJAX to load the content into the second div. The only problem that I see with this approach is that there would only ever be one page for your entire site.
  16. Different browsers treat the DOM differently. Try out both of these very similar scripts in both IE and Firefox: <html><body><div id="test"> <div></div> <div></div> <div></div></div><div id="Label"></div><script>var div = document.getElementById("test");var children = div.childNodes;var label = document.getElementById("Label");for(x in children){ label.innerHTML += x + ": " + children[x] + "<br />";}</script></body></html> <html><body><div id="test"><div></div><div></div><div></div></div><div id="Label"></div><script>var div = document.getElementById("test");var children = div.childNodes;var label = document.getElementById("Label");for(x in children){ label.innerHTML += x + ": " + children[x] + "<br />";}</script></body></html> If you set up your HTML like so: <div> <div></div> <div></div> <div></div></div> IE will see three child elements of the first div whereas Firefox will see 7 (3 elements and four [empty] text nodes - one for each line break).
  17. I think you pretty much have it. I've just made some minor changes: var listRequest;var headerRequest;function getlist(){ var listRequest = GetXmlHttpObject(); if (!listRequest) { alert ("Your browser does not support AJAX!"); return; } var url="./list.php"; url=url+"?sid="+Math.random(); listRequest.onreadystatechange=listStateChanged; listRequest.open("GET",url,true); listRequest.send(null);}function listStateChanged(){ if (listRequest.readyState==4) { document.getElementById("main").innerHTML=listRequest.responseText; }}function getheader(movieid, user){ var headerRequest = GetXmlHttpObject(); if (!headerRequest) { alert ("Your browser does not support AJAX!"); return; } var url="./header.php"; url=url+"?movieid="+ movieid; url=url+"&user="+ user; url=url+"&sid="+Math.random(); headerRequest.onreadystatechange=headerStateChanged; headerRequest.open("GET",url,true); headerRequest.send(null);}function headerStateChanged(){ if (headerRequest.readyState==4) { document.getElementById("topmenu").innerHTML=headerRequest.responseText; }}function GetXmlHttpObject(){ var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp;}
  18. You should match the number of subglobal# elements you have with the number of menu items you build.If you add a "subglobal1" then you can call "menu(#,1,xxxxxxx)". If you add "subglobal23" then you can call "menu(#,23,xxxxxxx)". The number that you are passing to the menu function has to match the number following one of the subglobal elements.
  19. jesh

    Is this legal?

    Maybe something like this would help you understand the XML DOM (as described in the tutorial). boen_robot's got to be one of the best people here to ask when it comes to how to do things with XML. I only use the DOM because it's the only way I know. // get a reference to the main element.var eventcatalog = myXMLdocument.getElementsByTagName("eventcatalog");// get all the events in the event catalogvar events = eventcatalog.getElementsByTagName("event");// get all the dates in the 3rd event elementvar dates = events[2].getElementsByTagName("dates"); I'm looking forward to seeing this as cross-browser compatible: http://www.w3schools.com/e4x/default.asp
  20. At the bottom of your page, you are calling the following: var menuitem1 = new menu(3,1,"hidden");var menuitem2 = new menu(3,2,"hidden");var menuitem3 = new menu(3,3,"hidden");var menuitem4 = new menu(3,4,"hidden");var menuitem5 = new menu(3,5,"hidden");var menuitem6 = new menu(3,6,"hidden");var menuitem7 = new menu(3,7,"hidden"); If you look at the function "menu", you'll see this: function menu(allitems,thisitem,startstate){ callname= "gl"+thisitem; divname="subglobal"+thisitem; this.numberofmenuitems = 3; this.caller = document.getElementById(callname); this.thediv = document.getElementById(divname); this.thediv.style.visibility = startstate;} So, if you called "new menu(3,4,"hidden")", it would look like this: function menu(3,4,"hidden"){ callname= "gl"+4; divname="subglobal"+4; this.numberofmenuitems = 3; this.caller = document.getElementById(callname); this.thediv = document.getElementById(divname); this.thediv.style.visibility = "hidden";} What happens next here is that document.getElementById is looking for an element with an id of "subglobal4" - but there aren't any elements with the id of "subglobal4". So, when you try to access the style object of this.thediv, you are getting an error.You'll have to match how many "subglobal#" elements you have on the page with the number of "new menu()" calls you make on the bottom of the page. If you only want 3 menus, and you only have "subglobal1", "subglobal2", and "subglobal3" in your HTML, then only use this in the bottom of your page: var menuitem1 = new menu(3,1,"hidden");var menuitem2 = new menu(3,2,"hidden");var menuitem3 = new menu(3,3,"hidden"); I hope I've explained this well enough!
  21. Did you see my post? http://w3schools.invisionzone.com/index.ph...ost&p=61439 Using that code, I was able to vertically center the image inside of the container div.
  22. Hmm, maybe something like this? <html><head><style type="text/css">#container { border: 1px solid green; height: 200px; position: relative; /* set a reference for child elements */}.centeringDiv{ background-color: red; text-align: center; /* this is to center the img (inline element) */ position: absolute; /* set the position to absolute */ top: 25%; /* and the top at 25% (this is in reference to the parent element) */ width: 100%;}img { vertical-align: middle; } /* this is to fix a weird issue in IE... */</style></head><body><div id="container" > <div class="centeringDiv"> <img src="http://www.w3schools.com/images/w3default80.jpg" /> </div></div></body></html> This worked for me in both IE and Firefox in the Tryit Editor. I hope it helps.
  23. jesh

    File Upload

    You could incorporate a "clear" or "reset" button that would enable the input again:<script type="text/javascript">function resetFile(){ var file = document.getElementById("file"); file.value = ""; file.disabled = false;}</script><input type="file" id="file" onchange="this.disabled=true;" /><button onclick="resetFile();">Reset</button>
  24. I think the problem may be here: strPath = Path.GetFullPath(postedFile.FileName) The mail message is being sent from the server. I believe, at this point, the file (postedFile) only exists on the server in memory as a memory stream rather than an actual file in the filesystem. You may have to save this file to a temporary location before you can attach it to your message.
  25. I'm not sure what, exactly, you are trying to do, but if that's the case (rollovers still work even if the window doesn't have focus) you can get a reference to the popup window like this: var wnd = window.open(url, name, features); Then, if you want to change the contents of the popup window, you can either change it's URL: wnd.location.href = "http://www.w3schools.com/"; Or, if you want to get at an element in the new window, you can go about that something like this: wnd.document.getElementById("MyElement").innerHTML = "Some new stuff."; How you fit that into your mouseovers is up to you.
×
×
  • Create New...