Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. Are you running this through a web server or are you running it from your file system? I mean, in the address bar of your browser, does it read something like "http://localhost/myfile.html" or is it something like "c:\files\myfile.html".I believe, in order to get this to work, you'll have to run it through a web server.Yeah, just ran a test locally. When I ran "file:///C:/Inetpub/wwwroot/fileinfotest.html", I got a null response for the headers but when I ran "http://localhost/fileinfotest.html", the headers returned as normal and I could get the Last-Modified date from the file. Which, when I think more about it, makes sense since we are trying to get the headers that come from the response from the web server. If you aren't being served this file from a web server, there aren't going to be any response headers.Hope this helps!
  2. jesh

    Extending HTML Forms

    I've never heard of the createFormField() function.In the past, I've used the XML DOM to generate elements in my page: var paragraph = document.createElement("p");paragraph.className = "foo";paragraph.innerHTML = "This is a new element!";document.getElementById("MyContainerDiv").appendChild(paragraph); Check out the XML DOM and HTML DOM tutorials.
  3. To get a reference to the window that opened your popup window, you can use window.opener. // get a reference to the parentvar parent = window.opener;// get the value from some element in the current windowvar somevalue = document.getElementById("ElementInChildWindow").value;// set that value to an element on the parent windowparent.document.getElementById("ElementInParentWindow").value = somevalue;
  4. It sounds like you are using Windows on your own computer (because of Notepad) - is the server Unix/Linux? I've run into a problem in the past (a long time ago, ack!) where when I developed the code on my windows computer and then FTPd it to the Unix server, the CRLF characters weren't working right on the server. It turns out that there was a setting in the FTP program that, when set, would convert those characters to characters that Unix/Linux would understand.As I said, that was a loooong time ago and I don't know if this still applies today. You might look into it though.
  5. jesh

    Valid Xhtml

    Interesting. Perhaps your computer is set up to use a different character set. Or perhaps you received the copy from somewhere else and copied the text from a Word document?In any case, glad I could be of assistance!
  6. It sounds like you've solved it. Just in case you didn't know, most regular expression implementations seem to have a flag that you can set which turns off case-sensitivity. java script: var regex = /test/i; C# Regex regex = new Regex(@"test", RegexOptions.IgnoreCase);
  7. Rather than registering test as an event handler for the keydown event on the document ( document.onkeydown = test; ) try registering it for the keydown event for your ricttext element. This way, if someone has focus on the area outside of the editor and clicks CTRL-B to open his/her bookmarks window, it'll still let him/her.Without looking too deeply at your code, maybe rather than: document.onkeydown = test; You might try something like: document.getElementById(iframe.id).contentDocument.onkeydown = test;
  8. jesh

    Complex Select

    Hmm, I see. Have you tried table variables (T-SQL) or temporary tables (MySQL) in a stored procedure? DECLARE @Temp TABLE( id int, year int, month int, day int)-- first, try to enter in all the quotes that have a yearINSERT INTO @TempSELECT * FROM jos_kacquotes aWHERE a.sub_year = @Year-- let's see how many we addedDECLARE @Count intSET @Count = (SELECT COUNT(id) FROM @Temp);IF @Count = 0BEGIN -- didn't add any, so let's add quotes that have year = 0 instead INSERT INTO @Temp SELECT * FROM jos_kacquotes a WHERE a.sub_year = 0END-- let's see, of the quotes we have, how many have month = @MonthSET @Count = (SELECT * FROM @Temp WHERE sub_month = @Month)IF @Count <> 0BEGIN -- we found some, let's delete any that aren't from that month DELETE FROM @Temp WHERE sub_month <> @MonthENDELSEBEGIN -- couldn't find any, let's delete any that don't have month = 0 DELETE FROM @Temp WHERE sub_month <> 0ELSE-- repeat step for month that we just did to get the ones that either have a day-- set or ones that have 0 for day if there aren't any that match our specific day-- once we have narrowed down the quotes in our temporary table, let's return the resultsSELECT * FROM @Temp In MySQL, rather than a table variable, you'd have to use a temporary table like so: CREATE TEMPORARY TABLE Temp ( id int, year int, month int, day int)
  9. jesh

    I wanna learn ASP

    Check out their (Brinkster's) knowledge base:http://kb.brinkster.com/Kb.asp?kb=107580
  10. jesh

    Valid Xhtml

    It looks like the ' has been converted to ?? in "isn't" and there is a different ’ rather than ' in "you'v". Are you, by chance, writing this page in a Microsoft product like Word or FrontPage? It could be that your application is putting in fancy single- and double-quotes rather than the plain ASCII single- and double-quotes - ' and " - and the validator might be choking on those characters.If this is the case, try opening your document in a text-editor - like Notepad - and converting all of the ’ to ' and the “ and ” to ".EDIT: Or, if you are dead-set on using the fancy quotes, try using HTML Entities instead.http://www.w3schools.com/tags/ref_entities.asp“ = “ (or & #8220;) for example.
  11. jesh

    ASP.NET Strings

    You could try out the System.IO.FileInfo class to easily get the file name: FileInfo fi = new FileInfo(strPagePath);strPageId = fi.Name;// OR, if you only want the page name and not the name.extension// strPageId = fi.Name.Replace(fi.Extension, ""); Using that same FileInfo object, you can get the directory information and split it on the '\' character: string directory = fi.DirectoryName; // C:\maindir\subdir1\subdir2 on my computerstring[] parts = directory.Split(new char[] {'\'} );strMainDir = parts[1];if(parts.length > 2){ strSubDir1 = parts[2]; if(parts.length > 3) { strSubDir2 = parts[3]; }} EDIT: Sorry, I don't know VB so my examples are in C#.
  12. jesh

    Complex Select

    Rather than using all the SELECTs, can you simplify your query as something like this: SELECT * FROM jos_kacquotes aWHERE (a.pub_year = 0 OR a.pub_year = $year) AND (a.pub_month = 0 OR a.pub_month = $month) AND (a.pub_day = 0 OR a.pub_day = $day)
  13. jesh

    Valid Xhtml

    It looks like you aren't closing your image tags.<img src="thumbimages/calmocean.jpg" alt="" border=""> should be more like <img src="thumbimages/calmocean.jpg" alt="" border="" />
  14. jesh

    Where are you?

    Not far from the Camelback Inn? Some of my family works there.
  15. jesh

    whats the difference???

    Right, when you aren't intending on breaking up the query string parameters with an &, but you need to display an &, you'd want to encode it:Penn&Teller (it's probably more like Penn%26Teller....) Maybe it's to increase internet traffic by 4 bytes ("amp;") for each query string parameter in requests.
  16. Looks like I used a wrong reference for the keycodes, sorry!I put this in the Tryit editor and it worked for both IE and Firefox - it even, because of the return falses - overwrites the default behavior for things like CTRL-B and CTRL-I.I hope it helps! <html><head><script>function test(e){ e = (e) ? e : window.event; var keycode = (e.which) ? e.which : e.keyCode; var ctrl = e.ctrlKey if(ctrl) { switch(keycode) { case 66: //b document.getElementById("div").innerHTML = "BOLD!"; return false; break; case 73: //i document.getElementById("div").innerHTML = "ITALIC!"; return false; break; default: document.getElementById("div").innerHTML = keycode; break; } } else { document.getElementById("div").innerHTML = keycode; }}document.onkeydown = test;</script></head><body> <div id="div"></div></body></html>
  17. jesh

    whats the difference???

    I might be totally off-base here, but what's the point of encoding the ampersands (&) to &? There'd still be an ampersand in there.
  18. jesh

    Some questions

    Yeah, you might be able to blow through the tutorials here and learn about all the different settings in a week. But it'll take years (as aspnetguy suggested) to really get a good handle on it. Best bet, run through the tutorials and then start building!
  19. Are you saying that the following produces errors?: if(empty($bruker) || empty($pass) || empty($mail)) As for checking if a username already exists, you might set the username column as an identity column which doesn't allow duplicates. Then, when you try to INSERT a record with a username that already exists in the database, the INSERT will fail. You could check after you attempt the INSERT whether an error was returned or you might be able to check how many records were affected - a successful INSERT would have affected 1 record wereas a failed INSERT would be 0 records. Alternatively, you could run a SELECT against the table for a record with a particular username. If the SELECT returns nothing, then you know that there isn't already a record in the database with that username and you can proceed with the INSERT.If you were using stored procedures, you could probably take care of this with one call to the database.
  20. I viewed it in IE 6 and was able to duplicate your problem. I, honestly, don't know why it's happening, but I did notice that when I viewed your css file, none of the CRLFs were being recognized correctly when viewed in Notepad. I could tell that there was a character there - the cursor would pause when I used the keyboard to move it over those locations - but it didn't put the text on a new line. Perhaps there is a conflict with the character set used to create the CSS file and IE 6 is having issues with it.Just a guess.
  21. Have you checked what data is being sent with the Request for your asp page? Perhaps there is a header in the Request which contains the data that you are looking for - perhaps the Referer? I don't play much with frames so I don't know if the referrer information will contain the URI of the last page the visitor visited or if it would contain the URI of the parent frame. I'm sure it's worth a shot.
  22. You can do multiple INNER JOINS: SELECT a.field1, a.field2, b.field2, c.field2, c.field3FROM TableA a INNER JOIN TableB b ON a.field1 = b.field1 INNER JOIN TableC c ON a.field1 = c.field1WHERE b.field4 = 'foo'
  23. jesh

    table row link

    Maybe you can use the click event on the table row: <table><tr onclick="location.href = 'http://www.google.com/';"><td>hello</td></tr></table> Or, rather than using location.href, you could specify your own function: <script type="text/javascript">function go(url){ location.href = url;}</script><table><tr onclick="go('http://www.google.com/');"><td>hello</td></tr></table>
  24. Your wz_tooltip.js files are different from one site to the other.http://www.crithappens.net/wz_tooltip.js t_tj.onmouseover = new Function('e', 'tt_Show(e,'+ '"tOoLtIp' +i+''+j+ '",'+ ((typeof t_tj.T_ABOVE != tt_u)? t_tj.T_ABOVE : ttAbove)+','+ ((typeof t_tj.T_DELAY != tt_u)? t_tj.T_DELAY : ttDelay)+','+ ((typeof t_tj.T_FIX != tt_u)? '"'+t_tj.T_FIX+'"' : '""')+','+ ((typeof t_tj.T_LEFT != tt_u)? t_tj.T_LEFT : ttLeft)+','+ ((typeof t_tj.T_OFFSETX != tt_u)? t_tj.T_OFFSETX : ttOffsetX)+','+ ((typeof t_tj.T_OFFSETY != tt_u)? t_tj.T_OFFSETY : ttOffsetY)+','+ ((typeof t_tj.T_STATIC != tt_u)? t_tj.T_STATIC : ttStatic)+','+ ((typeof t_tj.T_STICKY != tt_u)? t_tj.T_STICKY : ttSticky)+','+ ((typeof t_tj.T_TEMP != tt_u)? t_tj.T_TEMP : ttTemp)+ ');' ); http://www.crit-happens.net/wz_tooltip.js t_tj.onmouseover = new Function('e', 'if(window.tt_Show && tt_Show) tt_Show(e,'+ '"tOoLtIp' +i+''+j+ '",'+ ((typeof t_tj.T_ABOVE != tt_u)? t_tj.T_ABOVE : ttAbove)+','+// THIS IS WHERE IT IS DIFFERENT ((typeof t_tj.T_CLICKCLOSE != tt_u)? t_tj.T_CLICKCLOSE : ttClickClose)+','+// ===================== ((typeof t_tj.T_DELAY != tt_u)? t_tj.T_DELAY : ttDelay)+','+ ((typeof t_tj.T_FIX != tt_u)? '"'+t_tj.T_FIX+'"' : '""')+','+ ((typeof t_tj.T_LEFT != tt_u)? t_tj.T_LEFT : ttLeft)+','+ ((typeof t_tj.T_OFFSETX != tt_u)? t_tj.T_OFFSETX : ttOffsetX)+','+ ((typeof t_tj.T_OFFSETY != tt_u)? t_tj.T_OFFSETY : ttOffsetY)+','+ ((typeof t_tj.T_STATIC != tt_u)? t_tj.T_STATIC : ttStatic)+','+ ((typeof t_tj.T_STICKY != tt_u)? t_tj.T_STICKY : ttSticky)+','+ ((typeof t_tj.T_TEMP != tt_u)? t_tj.T_TEMP : ttTemp)+ ');' );
  25. Where does the variable i come from? Does i + j (i.e. numb) ever equate to a number that is larger than x.elements.length? If so, that might be the cause of your problem.
×
×
  • Create New...