2,040 Posted Topics
Re: The idea is to have a ctrl flag in your class. When a key press is a ctrl button, change the flag to true. When the key up is ctrl, change it back to false. Therefore, you could now check whether or not the ctrl is being held. In your … | |
Re: You are not allowed to close a tab in firefox. It is their policy to not allow it because user should have control over a page at all time. However, a pop up which is opened by javascript may be closed by its parent window using javascript... | |
Re: If you want to stop form from submitting, you may use 'onsubmit = "return aFunction()"' in form tag to do it. If the returned value is true, the form will be submitted; otherwise, it will stay on the page and wait for another submission. One problem here, if you have … | |
Re: Qwaz: The way you implement javascript argument is ambiguous. You must not have the same argument name, or the script will not know which argument you are calling. In this case, you have 2 of [b]id[/b] arguments in your function definition. Do the div 'thetext' and 'thetext1' have their own … | |
Re: And what's wrong with your code on IE9? You need to be more clear about this. Your code is very long and I do not have time to look at your whole code to figure out what the issue is... | |
Re: [QUOTE]Changing "CANCEL" button type to 'button' instead of 'submit' will cause the page not to refresh when I click "CANCEL". I need the page to refresh, in order to pass some $_POST values... [/QUOTE] What Luckychap means could be that you change the type of "CANCEL" to button and add … | |
Re: If you are using IE (and IE only), you may be able to access local storage to do what you want with JavaScript; otherwise, you cannot due to security... What would you want to do with the file using python? | |
Re: Can't get to the website... Only shows "No specified file" for me. I'm using FF as well. Anyway, I tried it locally, it works if you change... [CODE] if (num==0){var posy=0} if (num==1){var posy=-88} if (num==2){var posy=176} [/CODE] to [CODE] var posy if (num==0){posy=0} if (num==1){posy=-88} if (num==2){posy=176} [/CODE] The … | |
Re: How about using String class methods to do this for you instead of convert words to array? You could use substring(int beginIndex, int endIndex) to get a character for a word as string, and then use indexOf(String str, int fromIndex) to search for the selected substring inside another string. If … | |
Re: You need to look at what toString() of Object return. Also, you should use equals() for object comparison instead of attempt to compare using reference comparison symbol. You may need to read more about equals() in Java because it is not an easy topic. Furthermore, there are restriction and problem … | |
Re: What does the ProgramState class look like??? | |
Re: Make me think how do you open a new popup for your new window? | |
Re: It means if the value of the variable you are using in comparison is 1, 3, 5, 7, 8, 10, or 12, it would make these case statements true. As a result, the 'day' variable is assigned to 31. If you are assigning a value to a variable, you assign … | |
Re: You can do it either in div or textarea; however, the approach is a bit different. You need a highlight for div because there is no cursor location in div display (only highlight). In textarea, you can get the current cursor or highlight area. I did it for the company … | |
Re: If all you want is to display a text while mouse is over, you don't need onmouseover event. What you may want to do is title. [CODE] <a href="manatee.html" title="Click here to visit the manatee.">Manatee</a><br /> <a href="panda.html" title="Click here to visit the panda.">Panda</a><br /> <a href="polarbear.html" title="Click here to … | |
Re: Do you mean the integer from SearchWord, Search2Words, etc.? How do you associate these 2 classes together? You may need to acquire the values from your first class (ObtainKey) and then pass them to the second class (Search). Your class definition looks weird by the way... | |
Re: Next time, please use the CODE tag instead of upload the file. Also, you should post only the method you are having a problem with... Anyway in main method, you are implementing 2 sets of if-else statements. One is before the while loop and the other is inside the while … | |
Re: Old thread... Anyway, you may read [URL="http://www.activxperts.com/activcomport/howto/html/"]this[/URL] for possibility (require IE though). | |
Re: [QUOTE]exam 30% project 30% quiz 20% assign 10% notebook 10% grade 10% [/QUOTE] This part causes the confusion for the whole explanation... They don't add up to 100%; besides, where should quiz go into? How many points in it? | |
Re: You should check what value is actually returned from 'item_name.val()'. Alert it to see what actually is returned? (add alert(value) right after line 3 in your javascript code.) The reason is that it looks like your if-else statement is always false; as a result, it returns only else. | |
Re: Well, you may try to read [URL="http://www.permadi.com/tutorial/javaGetImagePixels/index.html"]this[/URL] for some more ideas. | |
Re: You are asking questions that are assignment to you. I am not supposed to answer this for you, but I will give you a couple links for you to look at. Please do not be lazy next time and search on the Internet or read from text books... Read [URL="http://www.janeg.ca/scjp/oper/string.html"]this[/URL] … | |
Re: What do you mean by documented? You mean something like [URL="http://getfirebug.com/wiki/index.php/Main_Page"]this[/URL] for Firebug? And for Dragonfly is [URL="http://www.opera.com/dragonfly/documentation/"]this[/URL]??? | |
Re: You can achieve that by adding a listener to the keyboard (attachEvent() for IE and addEventListener() for FF and some others); however, as Luckychap suggested, I don't think it is a good idea to do so. This is the design problem, and it should not be designed the way it … | |
Re: It works for me. By the way, I am using FF on Linux box. | |
Re: Wait for the web master to fix the javascript error. You can't do anything right now. | |
Re: Hmm... your script just uses external URL for the link. It does not try to open a new window for the link. Could you try the code below instead? (not verify it myself... just off the top of my head...) [CODE] document.write("<a href=\"javascript:window.open('"+sURL+"')\">Search Link</a>") [/CODE] | |
Re: This should not be in JavaScript forum... Also, JavaScript cannot send/manage e-mail for you. What you want would deal with server while JavaScript should be dealing with local computer only (except Ajax but still on the same domain). | |
Re: document.all[id].style is invalid in FF. There is no document.all in FF. Use document.getElementById(id) instead. | |
Re: You need to modify your string composition a little bit as below. [CODE] for (var count = 0; count < 20; ++count) { document.write(favSongs[count] + " (" + songYear[count] + ")<br />"); } [/CODE] | |
Re: "echo" is not a JavaScript function but it is PHP. Is this code in PHP? | |
Re: Yes and no. Yes if you use select tag and either a form (with server) or a function (javascript). There are many way to implement this. Not suggested (no) if you want to use textarea. Even though you could associate textarea tag with select options, it is not proper. There … | |
Re: Not sure if it is a bug. I would say it is the way IE caches web content and it is different from other standard browsers. Therefore, you may not expect the same behavior on IE if you have been familiar with other browsers already. | |
Re: You need to look into range selection; however, IE & FF & Chrome are not the same. For FF & Chrome, search the Internet for window.getSelection(). For IE, search for document.selection.createRange(). | |
Re: You are not supposed to access other domain because of security issue. This is just prevent you from hacking/attacking other site on purpose (doesn't mean it is a guarantee but for most of it). | |
Re: One add on, dynamically set visibility may not work on IE browser unless they have fixed the bug... | |
Re: Could you use 'screen.width' and 'screen.height'? [CODE] // try this to see if the screen resolution is displayed correctly <script type="text/javascript"> alert("Screen width: "+screen.width+"px\nScreen height: "+screen.height) </script> [/CODE] | |
Re: I doubt you can do it in JavaScript. The reason is that you are not permitted to access local storage via a web browser; however, IE could do that using ActiveX. Then, I highly doubt that any browser allows you to copy a file in local storage to another file … | |
Re: The code below just to show you how to do it (approximate time). I do not want to complicate the code, so it should be working in most cases. [CODE] <html> <head> <script type="text/javascript"> function redirectTo(url, timerID) { var el=document.getElementById(timerID) if (el) { // element exist el.innerHTML = 5 // … | |
Re: It may be your local browser security set up. The error seems to display the permission problem. | |
Re: #1, the answer is 'true' because JavaScript evaluates an integer string and an integer as equal in this case (17=="17") #2, the answer is 0 because the last assignment of y is 25 % 5 (25 mod 5). #3, should be for-loop as the answer because you knows the length … | |
Re: Where is the image area in your HTML code? Anyway, you may need to load both images but hide them while the page is being loaded (window.onload). Then you display a proper image when a proper value for date of birth is selected. There is a problem in your code … | |
Re: You need to show us some afford from your side first (some implemented code). I could do it but I feel that this is your assignment from school, so I should not spoil your learning. | |
Re: [CODE] window.einterval = setInterval("cst()", 5000); [/CODE] Is this also the cause of your editing (the window.einterval)??? | |
![]() | Re: What is offclick??? Do you mean if the text box was focused but a user does not fill value in it, a default value will be display when the user moves the focus to another element? Is it something like the sample code below? [CODE] <html> <head> function displayDefaultValue(inputElement) { … |
Re: Your code has problems in 2 places - default value for GateRequest0 in JScript and in HTML. In JScript part, at line #6, you try to get the current value which could be changed to 0 by the time you read it again. As a result, the value will never … | |
Re: It is the website's fault. Its JavaScript is broken (at least using IE browser to watch). You need to contact the web master. If you want a temporary fix, you may need to load your own javascript to fix that part, but I don't recommend. | |
Re: Which one are you talking about, redirect or set display time? To redirect, you may use window.location="<your_url_goes_here>"... If you want to sleep/wait before you invoke another function, you can use setTimeout("functionName(arg1, arg2, ...)", timeInMilliseconds) to do the delay where functionName(arg1, ...) is the function to be called after timeInMilliseconds has … | |
Re: I don't know... The way you access DOM is not intuitive. I am not sure that you would be getting what you want using for (item in content). Do you really know what [COLOR="Green"]item[/COLOR] is? I used Firebug, it gave me all including function pointers. If you want only 'input' … | |
Re: [CODE] var tempstr="-26.18101|-26.161011|"; // create an array within an array // [["-26.18101", "-26.161011", ""]] // as a result, -26.18101, -26.161011, undefined, undefined var latstr=new Array(tempstr.split("|")); // create an array // ["-26.18101", "-26.161011", ""] // as a result, -26.18101, -26.161011, undefined var latstr2=tempstr.split("|"); [/CODE] |
The End.