Jump to content

jesh

Members
  • Content Count

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. jesh

    Rng Problem

    If your script were to generate a number between 0 and 500, the first condition will always be true and you'll get page 18. Why? Because you are checking to see if the number is greater than or equal to 0 and less than or equal to 500. Since your numbers are between 0 and 500, that will always be true.This is more like what you're talking about: if(random_number >= 0 && random_number <= 9)else if(random_number >= 10 && random_number <= 19)else if(random_number >= 20 && random_number <= 29)else if(random_number >= 30 && random_number <= 39)...else if(random_number >= 490 && random_number <= 500)
  2. It might be because your background image has a gap in it:http://www.dallasnicol.com/images/menu/vMenu.png
  3. jesh

    Final Page Footer

    While you can control what is displayed on the webpage when you print it, you do not have any control over printer settings (margins, page size, page layout, headers, footers, etc.). If you're looking for a way to ensure that everyone prints out a copy of your content in the exact same way, you might look into creating PDFs of your content that users can download and then print.
  4. jesh

    Position

    Can you elaborate a little on what you mean by it screwing up?
  5. jesh

    Sql Server 2000 Utf

    So it sounds like the data is being stored correctly in the database but it is failing when it gets displayed in the browser. Is that right?If so, have you tried setting the Content-Type for the page? On our website, I just submitted data ("Überblick schließen über Befähiger Möglichkeits") with a form which got saved in the database in an nvarchar column, and when I load that content back up on the next page, it displays correctly. This is the HTML that is included on that page: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> We don't do any character encoding of the data other than HTML Encoding or URL Encoding, depending on where we're using it. And, in this particular, case, we just display the content on the page as it comes from the database.Here's a snippet of what it looks like in C# to fetch the data into an object: string header = datareader["ColumnName"] as string; And this is a snippet of how that string would be written into the HTML: htmlBuilder.Append("<div>" + header + "</div>"); I haven't yet had a reason to pass this type of data in a JSON object, however.
  6. jesh

    Sql Server 2000 Utf

    Are you storing it with varchar/text or are you using nvarchar/ntext?
  7. jesh

    Explode A Datetime?

    Maybe because you are echoing "<br /" instead of "<br />"?
  8. jesh

    About This Community

    Pretty much my exact experience. I was tired of lugging around a reference book and all my searches pointed to W3Schools. Finally, I joined the forum and started offering help to folks who needed it.
  9. jesh

    d/l a .pdf?

    Haha! It took me a few seconds to understand your comment until I finally noticed that the original posting date was "Apr 13 2006".
  10. jesh

    Ajax Post Examples?

    If you look at this section of JSG's code: function sendRequest(url,callback,postData) { var req = createXMLHTTPObject(); ... callback(req); ...} you'll see that the function calls your specified callback function and passes it a reference to the XMLHttpRequest object.So, in the case of the examples provided in this post, you can do this: function handle_response(resp){ document.getElementById('blah').innerHTML = resp.responseText;}sendRequest(url, handle_response, data);
  11. You want the form to change depending on the values of one or more of the other form elements? Do you know anything about the DOM?General HTML DOM Info:http://www.w3schools.com/htmldom/Creating Elements:http://www.w3schools.com/dom/dom_nodes_create.aspAdding Elements:http://www.w3schools.com/dom/dom_nodes_add.asp
  12. jesh

    Checkbox

    There are two ways to open up a new window in a browser: setting the target of a link or using window.open in javascript.If you don't care about changing the behavior when a user clicks on the checkbox and only want this to happen when the page first loads, you can set the target value in the code-behind.ASPX: <input type="checkbox" id="MyCheckbox" runat="server" /><a href="somepage.aspx" id="MyLink" runat="server">Click Me</a> C# if(MyCheckbox.Checked){ MyLink.Target = "_blank";}else{ MyLink.Target = string.Empty;} On the other hand, if you want this action to change as soon as the user toggles the checkbox, you'll have to do it on the client side:HTML <input type="checkbox" id="MyCheckbox" onclick="toggle(this, 'MyLink');" /><a href="somepage.aspx" id="MyLink">Click Me</a> Javascript function toggle(cb, linkID){ if(cb.checked) { document.getElementById(linkID).target = "_blank"; } else { document.getElementById(linkID).target = ""; }}
  13. jesh

    Image Move

    This line's gonna cause you some problems: document.getElementById('myimage').style.left=+i; I think it's just a typo of "+=", but you still have to specify a unit for this particular property (e.g. "px" for pixels). So, you might try this instead: document.getElementById('myimage').style.left = i + "px";
  14. jesh

    Preg_match

    I'm not too familiar with PHP's implementation of regular expressions, but, since you aren't really doing any grouping, I think you should lose the parentheses. Your expression is looking for one or more groups of single characters rather than one or more characters. $pattern = "/^[a-zA-Z0-9]+$/"; You could also search for any character that does not match your requirements. If there is a match here, the string is not valid: $pattern = "/[^a-zA-Z0-9]/";
  15. While DD is writing a response, you can check out this link for an explanation.http://pietschsoft.com/post/2008/02/JavaSc...Equivalent.aspxEDIT: An even better link: http://en.wikipedia.org/wiki/Foreach
  16. If you don't know anything about XML - and therefore, probably, little about XML DOM - you can also just use a StringBuilder to write out the XML and either save the file to disk or return it in a HttpResponse. StringBuilder xml = new StringBuilder();xml.Append("<ENVELOPE></ENVELOPE>");Response.Clear();Response.ContentType = "text/xml";Response.Write(xml.ToString());
  17. It's just the name of a variable. Convention makes "x" a very popular name for iterating through a for-each loop. It could just as easily have been: for (var anIndividualChar in found_chars)
  18. If you've been using ASP, you can switch from VBScript to Javascript for the server-side execution.Here's an example: http://www.tizag.com/aspTutorial/aspJavascript.php
  19. jesh

    Color Picker

    Yes, that's what nesting means. And no, you're not supposed to do it in HTML. You'll have to modify your code.
  20. jesh

    Sql Error

    You have a funky quote mark there instead of an apostrophe: ‘(123) 456-0000'), It should be: '(123) 456-0000'), EDIT: Beat ya DD.
  21. This page (http://www.gmarwaha.com/jquery/jcarousellite/#doc) says to set the "auto" property to some millisecond value: So, something along these lines perhaps?$(function() { $(".anyClass").jCarouselLite({ btnNext: ".next", btnPrev: ".prev", auto: 1000 });}); EDIT: Looks like they have a demo showing how the code is supposed to look:http://www.gmarwaha.com/jquery/jcarousellite/#demo
  22. Everything in your example would be commented out and there would be no code to execute.If you are just looking to separate out your code segments, you can do it like this: /* Begin first code block */Image1 = new Object();window.onerror=animation/* End first code block *//* Begin second code block */2nd Script [Roll Over]/* End second code block *//* Begin third code block */3rd Script [Menu]/* End third code block */
  23. You also have to have a static IP address for the DNS servers to resolve your domain name to your computer. If you have a dynamic IP address, then you'll have to track down one of the services that creates a static IP for you.For FTP, I've been using a Firefox extension called FireFTP. It meets all of my FTP needs.http://fireftp.mozdev.org/
  24. jesh

    Browsers

    You might be better off using IE's conditional comments for something like this. <html><body><!--[if IE]><script type="text/javascript">location.href = "http://www.w3schools.com/";</script><![endif]-->Hi non-IE user!</body></html>
×
×
  • Create New...