Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. jesh

    easy inner join

    Does this do what you need? SELECT m.idModelo, m.nombre, p.nombreProceso, ca.nombreCategoria, co.nombreColor AS colorFROM modelos m INNER JOIN procesos p ON m.idProceso = p.idProceso INNER JOIN categorias ca ON m.idCategoria = ca.idCategoria INNER JOIN coloresModelos cm ON m.idModelo = cm.idModelo INNER JOIN colores co ON cm.idColor = co.idColor
  2. You might try this: <script type="text/javascript">function getValue(){ var r = document.getElementById('field1').value document.getElementById("TextValue").innerHTML = r;}</script><div id="TextValue"></div><input type="text"value="hallo"name="field1" onblur="getValue();" />
  3. jesh

    Moving variables

    If you are developing a website using PHP, you can use one of the following methods:1) Sessions (see http://www.php.net/session or http://www.w3schools.com/php/php_sessions.asp)2) Cookies (see http://www.w3schools.com/php/php_cookies.asp)3) Query String Parameters (see http://www.w3schools.com/php/php_get.asp)
  4. jesh

    Date

    On SQL Server (T-SQL), you can use something like this: SELECT CONVERT(datetime, getdate(), 105); See http://doc.ddart.net/mssql/sql70/ca-co_1.htm for more info.On MySQL, it looks like you can use something like this: SELECT DATE_FORMAT(NOW(), '%d-%m-%Y'); See http://dev.mysql.com/doc/refman/5.0/en/dat...-functions.html for more info.
  5. I don't know that I've personally ever seen a website that is able to change my browser so that the window is in fullscreen mode. I'm not sure it's possible. What is possible is to open a new window with no toolbars, no status bar, etc and specify the width to be the width of the visitor's monitor and the height to be the height of the visitor's monitor, thus filling the screen with the browser. To do this, you need to get the size of the visitor's screen using javascript and then use those values in your window.open function. This link might help you in that regard: http://www.javascriptkit.com/howto/newtech3.shtml
  6. First, for changing the background color of the entire cell rather than just the span, you can do something like this: // rather than:// totalCell.innerHTML = "<SPAN STYLE='background-color: #FF0000;'>"+total+"</SPAN>";// try this:totalCell.style.backgroundColor = "#ff0000";totalCell.innerHTML = total; As for the other problem, I'm not entirely certain what you are trying to accomplish. Are you trying to loop through an array to add up all the elements to come up with a total? If so, try this: var total = 0;for(var i = 0; i < myarray.length; i++){ total += myarray[i];}
  7. Is this page up on the web? If so, if you can provide a link to it someone here might be able to help you further.
  8. jesh

    Site preloader

    An example (slightly modified...) of reportingsjr's method could look like this: <html><head><style type="text/css">#Content { display: none; }</style><script type="text/javascript">function LoadComplete(){ // hide the loading panel. document.getElementById("Loading").style.display = "none"; // show the content panel. document.getElementById("Content").style.display = "block";}// run the function as soon as the window is finished loading.window.onload = LoadComplete;</script></head><body><div id="Loading">Please wait while the site loads...</div><div id="Content"><!-- Your page goes here...--> <img src="image1.jpg" /> <img src="image2.jpg" /> <img src="image3.jpg" /> <img src="image4.jpg" /> <img src="image5.jpg" /> <img src="image6.jpg" /> <img src="image7.jpg" /> <img src="image8.jpg" /></div></body></html>
  9. jesh

    Date

    To each his/her own. I typically use the DB to generate dates because our application currently runs on multiple web servers and a single DB server. If I were to get the date off of one of the web servers, it could be slightly different than a date on one of the other web servers whereas if I get it off the DB server, all dates/times will be according to the same clock for all records.But, either way works.
  10. jesh

    Target links

    The idea here is that you specify a target for a link and the link will open up a new window and name that window with the target you specified. Any time the link is clicked after that, the window that opened up the first time you clicked on the link will be refreshed: <a href="http://www.google.com/" target="ComeGetSome">Here</a> Rather than a new window popping up each time you click that link, there will be only one window that opens and each time you click the link the window will refresh. A better example might be this: <a href="http://www.google.com/" target="ComeGetSome">Google</a><a href="http://www.w3schools.com/" target="ComeGetSome">W3Schools</a><a href="http://www.wikipedia.org/" target="ComeGetSome">Wikipedia</a>
  11. Yeah, I've run into this problem before. The following does not work: var div = document.getElementById("Container");div.innerHTML = "<script>alert('hello!');<\/script>"; It's possible that it is because of browser security, I'm not certain. It does work, however, if you use the method I described in my previous post (i.e. the eval(script.innerHTML)).
  12. Also, from what I understand, the merchant service actually charges against the credit card and immediately voids that charge to verify whether or not a card is valid.
  13. jesh

    Date

    This works in SQL Server: SELECT getdate()
  14. This article might help: http://www.codeproject.com/aspnet/image_asp.aspThe article was written for MySQL database, but it should help for any DBMS. The key point is when you get the data from the database, you'll use the Bitmap class to create a bitmap from a MemoryStream and send that bitmap to the browser:From the article:
  15. This article might help answer your question: http://alistapart.com/articles/horizdropdowns
  16. Can you tie in the code that you want to execute into your onreadystatechange handler in the XMLHttpRequest? That readystatechange event happens at each step in the creation, opening, sending, and receiving stage of the request. If you only execute code when the readyState property of the XMLHttpRequest is 4 ("complete"), it would essentially act like an onload event.It might also help to see some of your code.EDIT: If you want to execute code that is in the files that you are getting using AJAX, then you might try something like this: // get a reference to the element that is the container for the datavar div = document.getElementById("TheContainerDiv");// assign the content received from AJAX to the innerHTML of the div:div.innerHTML = ajax.responseText;// next, look in the div to see if there are any script elements:var scripts = div.getElementsByTagName("script");// loop through all the scripts:for(var i = 0; i < scripts.length; i++){ if(scripts[i].type = "text/javascript") { // eval what's in the script element eval(scripts[i].innerHTML); }} Some key points need to be made here, however.1) All the script elements in the files that you are getting with AJAX need to end with <\/script> rather than </script>.2) You'll want to be real sure that the code that is in those script elements is safe to be eval'd.I hope this helps.
  17. jesh

    AJAX

    Your ajax is attempting to get the content of the files at the following URLs - all of which return a 404 (file not found) error:http://kp.kovo.ca/documents1.html?rndval=1171556250156http://kp.kovo.ca/webg1.html?rndval=1171556137375http://kp.kovo.ca/3da1.html?rndval=1171556138687http://kp.kovo.ca/websites1.html?rndval=1171556139859http://kp.kovo.ca/logos1.html?rndval=1171556140718Are you sure those files exist in the root directory of your website?
  18. If you mean you want to be able to type in a URL into a text box and then click a button to redirect the browser to that URL, then the answer is yes!Check out the HTML DOM tutorials. I'd say way more than half of the scripting web developers do on the client side involves HTML DOM rather than javascript. It's worth it to learn as much as you can about it.In the meantime, what you want would look something like this: <input type="text" id="URLInput" /><button onclick="doit();">Go there!</button><script type="text/javascript">function doit(){ // get the value that is stored in our "URLInput" text box var url = document.getElementById("URLInput").value; // check to see if there is a value if(url != "") { // we found a value, let's redirect there. location.href = url; }}</script> You'd probably want to figure out some way to validate the user's input so that you only redirect when the input is a valid URL. If someone typed in "test" and clicked the button, that person would get an error. I'll leave that up to you.I hope this helps!
  19. Cool, I'm glad it worked. I wasn't able to test it in IE because I was using the Firebug extension to Firefox. If you haven't downloaded that extension yet, you ought to check it out!Anyhow, good luck with the site!
  20. I edited the CSS file to display your page correctly in Firefox. Here are the changes I made:
  21. First thing I see is that you have this in your style.css file: div.nav span.link{ display: block; float: left; color: #CD983B; margin-top: 10px; padding: 6px 0px 6px 10px;} font-weight: bold; padding-left: 20px;} Perhaps this is the cause of your problems.
  22. jesh

    easy inner join

    Maybe an example would help. Suppose, based on your original post, you had the following: A query to get the username of the user and the description of the product for each order would look like this:SELECT users.userName, products.descriptionFROM ordersINNER JOIN users ON orders.idUser = users.idUserINNER JOIN products ON orders.idProduct = products.idProduct It all really depends on how each of the tables relates to one another.Also, when JOINing tables, it might help to look into using LEFT JOINs and RIGHT JOINs if necessary. The W3Schools page on SQL JOINs helped me when I was first learning: http://www.w3schools.com/sql/sql_join.asp
  23. It'd be just like justsomeguy posted:
  24. If you decide to build your own, an easy way to implement this in .NET is to handle it in the Application_BeginRequest event handler in the Global.asax.cs (or Global.asax.vb if you're using VB) file. using System.Web;public class Global : HttpApplication{ protected void Application_BeginRequest(Object sender, EventArgs e) { // This method runs as soon as a request is sent to the web server for // any resource in your .NET website. You can get the path to the file here. string path = HttpContext.Current.Request.Url.AbsolutePath; // "path" will now store the file name for your page. This is where // you could put the code to increment a counter that keeps track of // how many times the page has been loaded. This data could be // stored in a database or in a file on the server's hard drive. // Once all the code in here executes, the request gets sent on its // merry way. }}
  25. You might look into using location.href. // This line of javascript sends the user to w3schools.comlocation.href = "http://www.w3schools.com/";
×
×
  • Create New...