Jump to content

jesh

Members
  • Content Count

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. jesh

    Java Cookie

    You could write a function that does it for you. See this page for an example:http://www.w3schools.com/js/js_cookies.asp
  2. jesh

    Value

    It looks like you're trying to access the values of the elements before they exist on the page.Try this: password <input type="hidden" id="password_chk" value="5753020">user <input type="hidden" id="username_chk" value="afifiman1">ans <input type="hidden" id="MyNumber" value="43467"><script type="text/javascript">var params = "";var objValue = document.getElementById("MyNumber");var objUser = document.getElementById("username_chk");var objPass = document.getElementById("password_chk");var params = "?choice=" + objValue.value + "&username_chk=" + objUser.value + "&password_chk=" + objPass.value;document.write(params);document.write("<br />");</script>
  3. Also, as it stands, the "this.style.backgroundImage" is referring to the img element rather than the body. Once you get the other stuff sorted out, you might try: document.body.style.backgroundImage = "url(theimage.jpg)";
  4. I can't speak for PHP, but C# struggles significantly in parsing XML into an object when there are more than, say, 50,000 elements in the document. If you're ever going to do any PDF generation of recordsets which contain tens of thousands of records, you might want to look for an alternative approach.
  5. http://www.w3schools.com/css/tryit.asp?fil...ound-attachment
  6. First, you're going to need a way to come up with two random numbers between 1 and 6.http://java.sun.com/j2se/1.5.0/docs/api/ja...til/Random.htmlThen, you're going to have to figure out how to write information to the console.http://java.sun.com/javase/6/docs/api/java...lang.Object...)
  7. You're only reading from 0 to ReceiveBufferSize. Is the data longer than the ReceiveBufferSize?Typically, when you work with sockets, you read the data in a while loop:http://msdn.microsoft.com/en-us/library/sy...px#snippetGroup
  8. jesh

    Over The Top

    You can use the "z-index" property.http://www.w3schools.com/css/css_positioning.asp
  9. jesh

    File Upload Control

    The only thing I can think of would be to serialize the image to a string and store that string in the XML, but I can't imagine that being very efficient.If that's the route you're looking for, you might check out the BinaryFormatter class.I've used the BinaryFormatter, coupled with the GZipStream, to serialize objects in the past.
  10. As a C# .NET developer, I just wanted to throw in my two cents. I think you're spot-on in your statement. I find it frustrating that 90% of the postings I find out there related to .NET are either in VB or they are from people who build their web applications using the WYSIWYG designer in Visual Studio.However, once you know where to look, .NET (C#) is incredibly powerful and you have control over everything from the moment the request hits IIS to the point where you close the HTTP response back to the browser.As for your example with SHA-1, you don't need to do anything with the wacky FormsAuthentication stuff, there appears to be another method in the system.security.cryptography.sha1 class.So, I'd vouch for C# as a full-fledged programming language and for .NET as a development framework, you just have to, like justsomeguy said, get past all the people out there that are developing .NET applications who maybe aren't actually qualified to do so.
  11. jesh

    Css Order Problem

    The c2 class takes precedence because the p element has that class explicitly associated with it. The p element will inherit any styles from its parents (e.g. the div with the c1 class and the div with the c3 class), but the c2 class will take priority over those rules.
  12. jesh

    Mysql Select Query

    Something along these lines should work for you: SELECT Name, COUNT(Songs) FROM MyTableGROUP BY Name
  13. Rather than: var site = document.getElementById('site').value; You might try the following: var select = document.getElementById('site');var site = select.options[select.selectedIndex].value;
  14. Also, I'm willing to bet that more people have a Flash plugin installed on their browsers than they do the Java runtime environment. More people would be able to see your work if you did it in Flash.
  15. Here's the first part of your original java script: function confirmEmail(theSame) { if (theSame.textfield4.value != theSame.textfield5.value) ...} This is trying to find the "textfield4" property of the object that you passed to the function, looking at its value property and then comparing that to the value property of the "textfield5" property of the passed object.If you pass "this" from the context of an input element, "theSame" is going to be an input element. So the code, as written, is trying to find a property of that input element called "textfield4" and another called "textfield5". Those aren't actually properties of the input element at all, they're properties of the input element's parent form element. That's why you would need to either modify your HTML so that you pass a reference to the form element to your function, or you modify your javascript so that you get the form element from the input element before you start your comparisons.Does that help?
  16. When you pass "this" to the onblur event handler in your input element, you are passing a reference to the input element, not the form: <input type="text" name="textfield5" onBlur="confirmEmail(this);" size="30" maxlength="30"> Either, modify your HTML so that you pass a reference to the form: <input type="text" name="textfield5" onBlur="confirmEmail(this.form);" size="30" maxlength="30"> Or, modify your java script: function confirmEmail(theInput) { var theForm = theInput.form; if(theForm.textfield4.value != theForm.textfield5.value) { alert('Please check or re-type your email address'); return false; } else { return true; }}
  17. Just for the sake of learning, another approach would be to create a string of valid characters and then create a random number between 0 and the length of your string to get an index. Then use that index to return a specific character from your string. Do this how every many times you need to create a password that is the appropriate length.As an example, here's how you could use this method to create a random color hex code: <html><body><script type="text/javascript">var chars = "0123456789ABCDEF";var hex = "";var rndIdx = 0;for(var i = 0; i < 6; i++){ rndIdx = Math.floor(Math.random()*chars.length); hex+= chars.substr(rndIdx,1);}document.body.style.backgroundColor = "#" + hex;</script></body></html>
  18. That's what that company does that I mentioned in my previous post. It's not free though.https://www.digimarc.com/mypicturemarc/how-...lt2.asp#console
  19. I have never used dreamweaver, I couldn't tell you.
  20. jesh

    Math Random

    The point that justsomeguy is making is that random number generators are based on deterministic algorithms - if you pass "1234" as the seed to a random number generator in C# you get the same results every time you execute the code:Random rnd = new Random(1234);for (int i = 0; i < 10; i++){ Response.Write(rnd.Next(10) + " ");} This code outputs the following EVERY time without variation. Now, if you use the time as the seed, you, as a human, don't really know what that number might be so it appears to be random, but it is still totally deterministic. It is pseudo-random.
  21. You can use CSS to set the border of any img element that exists inside of an a element to be 0 pixels. <head><style type="text/css">a img { border: 0; }</style></head><body><a href="http://www.w3schools.com/"><img src="http://w3schools.invisionzone.com/style_images/6_logo.png" /></a></body>
  22. Ingolme is right, you'd have to place a watermark on your images. These watermarks, however, can be invisible to the human eye. It's called steganography and my buddy works at a place that offers this service.
  23. jesh

    Problems With Encoding

    I've never created a vcf card before and have never seen the MIME type "text/x-vCard" either. However have you tried "utf-8" for the character set instead of "1252"? response.Clear();response.Charset = "utf-8";
  24. Yeah, you can't map a path on the server to "<all><node>TEST</node></all>".You can, however, create an XPathDocument using any stream that you want, including the stream that exists in the StringReader: public void Page_Load(Object sender, EventArgs E){ // Prepare an XPathDocument object. string xml = "<all><node>TEST</node></all>"; StringReader reader = new StringReader(xml); XPathDocument doc = new XPathDocument(reader); // And then prepare an XslTransform object. string xslPath = Server.MapPath("XSL.xsl"); string id = Request.QueryString["id"]; XsltArgumentList args = new XsltArgumentList(); args.AddParam("id", "", id); XslTransform xslDoc = new XslTransform(); xslDoc.Load(xslPath); // Transform the XPathDocument object. xslDoc.Transform(doc, args, Response.Output);}
  25. I think it has to do with the way that you're marking up and styling the image and it's parent container (the div): <div id="imgContainer" class="imgContainer">Set coordinates:<br/><img id="imgHolder" onclick="getCoords(event)" src="desk1.gif"/></div> The div "imgContainer" is styled with an absolute position 250px from the top. When you look at the offsetTop for the "imgHolder" img element, it reports that as being 250 rather than the 270 (or so) that it actually is. I believe this is because of the inline content that is included in the div. If you remove the text and the br element, the code functions as you'd expect it to: <div id="imgContainer" class="imgContainer"><img id="imgHolder" onclick="getCoords(event)" src="desk1.gif"/></div>
×
×
  • Create New...