Jump to content

jesh

Members
  • Posts

    2,293
  • Joined

  • Last visited

Posts posted by jesh

  1. Java is used for far more than web applications/applets. While I couldn't name any real world products that use Java (not because there aren't any but because I don't know of any) there must be some.
    Ah, yes.
  2. You might have to encapsulate the data with quotation marks and then have your parser ignore commas that exist within quotes.For example:

    1,55,test,"This is a sentence that may contain a comma.",62,55,test,"This sentence, here, has two commas.",6
  3. I gave up on Java 6 years ago. Is it really as popular now as you are saying it is? I don't see too many sites with .jsp or .jhtml file extensions these days. And Flash seems to be much more widely used than Java Applets.

  4. I only thought it'd be better because you'd still be able to see what the alerts where supposed to be alerting. If you are OK with completely ignoring the messages until you are logged in, then function alert() {} would probably be the best way.

  5. Reason why I wanted to know that is cos, my friend has this login system which when the user registers in the website, it takes only login name and gives him 4-digit [numeric] as password, so i thought it would be easy to hack [just to prove its a bad idea]. If I know the login name then all I need is to use JS and fill the username textbox with that and loop through all 4 digit numbers and one of them will login. but the only problem is that every time when the login is incorrect it popups a message, if I could close it then loop will continue.... :)
    ROFL, check this:http://www.webmasterworld.com/forum91/1274.htm
    Quick and dirty, but it works (tested in IE6):function alert() {}
    I just tested in Firefox and it works too...EDIT: This may be even better:
    function alert(string){	document.getElementById("display").innerHMTL += string + "<br />";}

  6. I think you will really like this http://developer.mozilla.org/en/docs/A_re-...n_to_JavaScriptRead the whole thing, I learned stuff that I never knew before!!!
    Great link. Within the first couple of sections I learned this:
    If you want to convert a binary number to an integer, just change the base:> parseInt("11", 2)3
    Which means this:
    var decimal = parseInt("FF8C00", 16)

    would have come in real handy for me when I was writing some color functions...

  7. Hello thanks man. That was the stupidest thing error. Acually I was making it all on my server and then I had to upload it on the awardspace server so I forgot to change it. How did you find it out? Is there a tool that you use??
    Not in this case. I just viewed your source and saw that your code referenced a javascript. I viewed that script (by typing in the address in my address bar) and saw the problem.I suppose I could have just clicked on the "Script" tab in Firebug, but that's still a new Firefox extension for me and I'm still stuck with old habits. :)
  8. Yeah, they are search patterns.

    var string = "  this is a test";string = string.replace(/^\\s+/g, '');

    Does the same thing as:

    var string = "  this is a test";while(string.substring(0,1) == " "){	string = string.substr(1);}

    As for other things you can do with javascript. Take a look at bit shifting (the << and >> operators). I don't fully understand it but I've seen some cool things done with it.Also, a fun one I've learned recently is that you can pass a reference to a function as a parameter to another function and then call that function on the inside:

    function a(string){	alert(string);}function b(string, func){	func(string);}b("What's up?!", a);

  9. Thanks it worked, but now I am getting a brand new error, look at this http://workbench.awardspace.com/ . After one clicks on submit, see Firebug
    It's because of cross server scripting. The page is being displayed at http://workbench.awardspace.com, and, hence, the javascript is being executed from there. However, the URL for your AJAX request is going to http://localhost/D6S/signup/signup.php?q=0". AJAX doesn't allow that.Try sending the AJAX request to "signup.php?q=0" instead.
  10. I believe this code was compliments of jesh.
    :)
    Yeah me too.... Never tried to write one on my own, always looked to find something online incase there is no other way other than using regex...
    Although I found that they had a very steep learning curve, Regular Expressions aren't really all that difficult once you understand them. And they are ridiculously powerful.
  11. Hmm...execution of the javascript pauses on alert. Could you do something like this?

    ...alert("An error has occurred, this window will close...");window.close();

    Or, if you are trying to close a child window whose reference is held in a variable called "wnd", it'd be something like this:

    ...alert("An error has occurred, the child window will close...");wnd.close();

  12. Can you set the value of the vb variable to a hidden input inside a form?HTML:

    <input type="hidden" id="username" />

    VB:

    document.getElementById("username").value = objNetwork.UserName

    Then, when you submit the form to the PHP page, it can see what the value of "username" is.

  13. If "file" (or "files") is a directory, you can't save a file with that path. What you can do is save a file in that directory.You are still running:

    postedFile.SaveAs(savePath)

    Rather than

    postedFile.SaveAs(savePath & "\" & filename)

  14. I seriously don't know how to do this in VB, but in C# you'd want to make sure you are trying to save the file to something like C:\Inetpub\wwwroot\tuition\files\MYFILE.EXT rather than C:\Inetpub\wwwroot\tuition\files. I think Windows is having a cow that you are trying to save a file as a directory.C#:

    string savePath = "C:\\Inetput\\wwwroot\\tuition\\files\\";...postedFile.SaveAs(savePath + filename);

  15. Are you able to use Table variables in SQL Server 2000 like you can in SQL Server 2005? If so, might it be faster to run multiple INSERTs into that table variable and then do the joins on it rather than the multiple sets of joins?

    DECLARE @CIDs TABLE(	cid int)

  16. I see you are using AJAX. If you want to simply have the script wait for a set amount of time before it runs, then what vijay wrote is exactly right. If, however, you want to wait for the response to come back from the AJAX request before you execute code, you'll want to use your ajaxResponse function as an event handler like this:

    xmlHttpObj.onreadystatechange = ajaxResponse;xmlHttpObj.open("GET", url, true);xmlHttpObj.send("");function ajaxResponse(){	if(xmlHttpObj.readyState == 4)	{		if(xmlHttpObj.status == 200)		{			var updtDiv = document.getElementById("updateDiv");			updtDiv.innerHTML = xmlHttpObj.responseText;		}	}}

×
×
  • Create New...