Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Everything posted by jesh

  1. hah! That's how I felt when you told me I could simply do:mystring.Split(','); Rather than mystring.Split(new char[] {','});
  2. MSN Messenger used to have an API that I would play with in either VBScript or Javascript. I once had a (stupid) competition with one of my contacts to see who could write the other person faster when they first signed on so I wrote a script that would automatically send him an IM as soon as he logged in.What you experienced may have been something done through the API. Try a Google search for the API: http://www.google.com/search?source=ig&amp...N+messenger+API
  3. You can use both, I rarely, if ever, use Request.QueryString["id"]. I almost always use Request["id"]. The only time I ever use the QueryString property is to get the entire QueryString.
  4. Ahh, right you are, you still have to append the element to the document. But, just so you know, Prateek, there is no reason in doing the document.getElementById("jsConsole") at this point because you already have a reference to that element in "newDiv".
  5. This code works for me in both Firefox and IE: var newDiv = document.createElement("div");newDiv.id = "jsConsole";newDiv.style.height = "44px";newDiv.style.backgroundColor = "red"; You get the error when you try to set the height? Or are you getting the error when you try to append the element to the document?
  6. Have you looked at the ADO tutorial? Maybe this example will help: http://www.w3schools.com/ado/showasp.asp?f...emo_ado_getrows
  7. Yeah, the Click event for buttons and hyperlinks is handled AFTER the Load event for the page. One way you might do it would be something like the following (pardon my C#, I don't do VB): protected void MyLink_Click(object sender, EventArgs e){ Button button = (Button)sender; Server.Transfer("Page2.aspx?id=" + button.ID);} Then, on the second page, get the value of the button id like so: protected void Page_Load(object sender, EventArgs e){ string buttonID = String.Empty; if(String.IsNullOrEmpty(Request["id"]) == false) { buttonID = Request["id"]; }}
  8. Ahh, nice. If you ever run into that problem again, depending on which database system you are using, you can force the database to use your column names by putting it in square brackets: INSERT INTO mytable (Username, [Password]) VALUES ('test', 'test');
  9. Choco had the answer: Download the FireBug extension for Firefox.
  10. For more info on the createElement, createTextNode, and appendChild methods, check out the XML DOM tutorial.
  11. Have you tried adding a clear? Something like this: <div id="body"> <div id="email"> </div> <div id="content"> <p id="layoutTitle">Welcome to MikeYuhaniak.com!</p> <p id="layoutTextarea"> <img id="layoutImage" src="images/userPics/Home6.jpg?78" align="right">This page is currently under construction. Please check back soon for updates. <br style="clear: right;"> <br> Posted 03/09/07 </p> </div></div> When you float content, you have to clear the float later on or else the containing element won't expand to encompass the floated content.
  12. I don't know about getType, but you might try the modulus operator (%) which, if you didn't already know, returns the remainder of one number divided into another number. For example, 5 % 2 == 1 because, when you divide 2 into 5, there is a remainder of 1. You can use this to get whether a number is even or not. An odd number % 2 will always return 1 whereas an even number will always return 0. $number = 5if(is_numeric($number) AND ($number % 2 == 0)){ echo "<br />The number ", $number, " is even.";}else{ echo "<br />The number ", $number, " is odd.";}
  13. Oh, I forgot to mention that you also will want to set the Content-Type and Content-Length for the request. Some servers may not accept a POST request without those headers: var data = "xml=" + xmlData.xml;xmlhttp.onreadystatechange=state_Change;xmlhttp.open("POST",url,true);xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");xmlhttp.setRequestHeader("Content-Length", data.length);xmlhttp.send(data);
  14. It sounds like the problem is with the INSERT statement. When I have to dynamically build SQL statements in code (rather than use a Stored Procedure), I tend to echo (Response.Write) the statement to the screen before I attempt to run it on the database so that I can visually see what the statement renders out to. It's usually something simple like one too many commas or missing quote marks. Try that and see what the statement looks like.
  15. jesh

    Learn VBScript?

    I made a little vb script to run instead of a batch file when I want to start certain applications with one click rather than one click for each application. Here's part of it: Dim shellSet shell = WScript.CreateObject ("WScript.shell")shell.run("C:\visual_studio")WScript.Sleep(1000)shell.run("C:\widget_engine")WScript.Sleep(1000)shell.run("C:\iTunes")WScript.Sleep(1000)Set shell = Nothing Seriously though, I tend to avoid VB (and VBScript) like it was the plague and I just can't understand why it is so popular (in ASP and ASP.NET).
  16. jesh

    popup box

    Well, I can tell you that setting the location.href to a reference to a window (as opposed to a URL) will never work so I suggest ditching that piece of code.
  17. Well, I think two ways have been discussed in this thread:1) Pre-load all the images on your site on the first page a visitor comes to when they first hit your site (e.g. index.html). Then, once the page has loaded, all of the images that a visitor might see would then be on that visitor's cache. Once this happens you can redirect the user to the real first page of your site (e.g. page1.html). The next time the visitor comes to your site, they'll hit the index.html page and almost immediately be sent to page1.html because the images will have loaded from cache. This is how the example in my previous post works.2) Pre-load all the images on the page. Once all the images have loaded, hide the "This page is loading" div and show the main content div. That'd look more like this:<html><head><style type="text/css">#Content { display: none; }</style><script type="text/javascript">function showImages(){ document.getElementById("Loading").style.display = "none"; document.getElementById("Content").style.display = "block";}</script></head><body onload="showImages();"><div id="Loading">Please wait while this page loads...<img src="someanimatinggif.gif" /></div><div id="Content"> <img src="images/image1.jpg"> <img src="images/image2.jpg"> <img src="images/image3.jpg"> <img src="images/image4.jpg"></div></body></html>
  18. jesh

    popup box

    I've never used prototype, so I don't know if this is the problem, but it looks like it could be. You're attempting to redirect the page (location.href) to a couple of lines of javascript rather than an actual URL.Rather than: onclick="window.location.href='var win = new Window({className: 'spread', title: 'Ruby on Rails', top:70, left:100, width:300, height:200, url: 'http://www.rubyonrails.org/', showEffectOptions: {duration:1.5}}); java script:win.show()'" You might try: onclick="var win = new Window({className: 'spread', title: 'Ruby on Rails', top:70, left:100, width:300, height:200, url: 'http://www.rubyonrails.org/', showEffectOptions: {duration:1.5}}); win.show();"
  19. Well, if the browser waits for all those images to download before redirecting the user to the second page, then that div gives the user something to look at while they wait.
  20. I think the problems you are having are because you have some HTML in that page. The browser sees "<html><head><title>Test 2</title></head><body><IMAGE DATA HERE></body></html>" with a content type of "image/png". Last I checked, PNGs can't have HTML in them.Try removing all the HTML and just keep the PHP that you have.
  21. Yes, you should be able to switch over to MySQL. Rather than using SqlConnection, SqlCommand, SqlDataReader, etc., you'll have to download the MySql ADO.NET drivers and use MySqlConnection, MySqlCommand, MySqlDataReader, etc..Here is some documentation: http://dev.mysql.com/doc/refman/5.0/en/connector-net.htmlAlso be aware that there are some slight syntax and keyword differences between MySQL and MSSQL queries.
  22. You could use one js file:showimages.js var image1 = new Image();image1.src = "/images/image1.jpg";var image2 = new Image();image2.src = "/images/image2.jpg";var image3 = new Image();image3.src = "/images/image3.jpg";var image4 = new Image();image4.src = "/images/image4.jpg";var image5 = new Image();image5.src = "/images/image5.jpg";funciton showImages(){ location.href = "/page2.html";} Then, in your HTML: <html><head><script type="text/javascript" src="showimages.js"></script></head><body onload="showImages();"><div>Please wait while the images load.</div></body></html> As for how long it would take, that totally depends on the user's connection. Someone with dialup will take longer than someone with broadband.
  23. jesh

    base href

    You're not going to be able to do that with CSS, but you may be able to do it with java script: function changeBase(){ var base = document.getElementsByTagName("base")[0]; if(base) { base.href = "http://somedomain/somedirectory/"; }}window.onload = changeBase; If you saved that in an external javascript file and included a reference to it on all of your pages, it might work for you. The only reason I say might is because I've never done this with the "base" element and I don't know if the DOM behaves the same with it as it does with all the other elements. It'd be worth a try though.
  24. jesh

    css

    I think what is confusing here is that you say you are using "<html:link>" which isn't valid HTML. I did a quick Google search and it looks like maybe "<html:link>" is part of Struts? If so, what's probably happening is the server parses through the code, sees "<html:link>" and then converts it to "<a>". You might load up the page in a browser, right click on the window and choose "View Source". Where you see links in that rendered page, you're 99.9% likely to see <a></a> elements. In that case, use what jlhaslip suggested to style those links.
×
×
  • Create New...