3,892 Posted Topics
Re: [code]<script type="text/javascript"> document.getElementsByName('rand')[0].value = document.getElementsByName('main')[0].src; </script>[/code] The function [ICODE]getElementsByName [/ICODE]returns a [ICODE]nodelist [/ICODE]i.e. an array of all the elements which go by that name. Hence the array indexing operator [ICODE][][/ICODE] is a must. If you are pretty sure that there is only one element on the entire page which goes … | |
Re: If you want to share something good with the others out there, we have a [URL="http://www.daniweb.com/code/javascript.html"]code snippets section[/URL]. Threads posted in normal forums end up getting lost in the sands of time. ;-) | |
Re: The error "MyRemote cannot be resolved to a type." seems to be pretty straightforward; you need to include the 'MyRemote' class in your JSP for it to successfully compile. I know this advice would fall on deaf ears but avoid using scriptlets in your JSP's, put the application logic in … | |
Re: There is no [icode]navigate[/icode] function for the [icode]window[/icode] object. Maybe try something like: [code] <?php function reDirect($page) { $s = "<script language = 'javascript'> window.location.href = '$page'; </script>"; return $s; }[/code] | |
Re: > If I have a variable named X , and this virable hold some data , how can I know > the Type for that data The [I]typeof [/I]operator should make things a bit easier for you. Try this: [code] <script type="text/javascript"> var i = 0; alert(typeof i); // number … | |
Re: Your issue has got nothing to do with Javascript; it is handled when deploying your web application on the web server / container of your choice by means of a configuration file. Consult your web server's documentation for more details. | |
Re: Place the block of Javascript code *after* the DIV tag and things should work out fine. It problems still persist, consider attaching a listener to the onload event handler of the window object which would execute the required Javascript only after the entire page has loaded. | |
Re: There are at least [URL="http://forum.java.sun.com/thread.jspa?threadID=642042&messageID=10137425"]millions of threads[/URL] out there providing a proper solution to the same problem; maybe doing a bit of research on your own would help you understand the way things work. | |
Re: [QUOTE=maui_mallard;559530]YEAH I Know... Ill be up to you in NO TIME[/QUOTE] You have already started your journey the 'Bennet way' it seems. [B]Hint: [/B]Your signature. | |
Re: Please explain your problem in a better manner. If there is a server side processing involved when interacting with the HTML control, then yes, you can write whatever data is present in the form (plus something totally unrelated) to a text file which would be created on your server. When … | |
Re: There are many free / open source Javascript calendars out there. Just key in 'Javascript calendar' in Google and you would be a few steps away from getting one... | |
Re: > But the program stops in the first null line. [inlinecode]null != empty_line[/inlinecode] A null returned signifies that a end of file has been reached and has got nothing to do with empty lines. Inside your loop, just check to see if [inlinecode]str.trim().length() != 0[/inlinecode] and write that line to … | |
Re: > but I dont know why JSP gives this result : Maybe because "KodeAlbum" actually contains "000002-0015"? It would be better if you printed out the value of the form field "KodeAlbum" after form submission and made sure it is the same as you want. If yes, then the change … | |
Re: What do you mean by 'open PDF' files using Javascript? You need the appropriate softwares for opening the respective files e.g. Acrobat reader for PDF files. The maximum you can do is make the browser open up a prompt box which would give you the option of either saving the … | |
Re: This happens almost always due to Javascript errors and the Javascript on that page looks all messed up. Remember that IE is more forgiving and will automatically make up for your mistakes; Firefox won't. Your best bet would be to get your generated HTML validated, look for any glaring markup … | |
Re: Phew! Next time make sure you attach your code instead of dumping the entire 1.6K line thing on the message boards. | |
Re: According to the HTML 4.01 specification: [quote]ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").[/quote] Plus NAME attribute is deprecated for *non-form* elements; use ID instead. And a better … | |
Re: You need to toggle the rendering and not visibility. Even invisible elements takes up space on the page. Use the "display" property to create invisible elements that do not take up space. [code]<div id="testDiv" style="display: none;">Content</div>[/code] | |
Re: Your question would be more pertinent in the [URL="http://discuss.joyent.com/viewforum.php?id=20"]SIFR forums[/URL] than here. | |
Re: > Ok so here is the code I am using and all I am getting is a blank page. A few things: - [ICODE]window.location[/ICODE] is a host object (browser object); what you probably need to do here is [ICODE]window.location.href = 'url'[/ICODE]. Even though the former works, it's an incorrect way … | |
Re: Look closely at the code you have written. The tag <jsp:param> doesn't have a body and hence should be written as one. Leaving them open is what is causing the problems here. It should be: (notice the slashes at the end of the param tag) [code] <jsp:params> <jsp:param name="textcolor" value="#FFFFFF" … | |
Re: Use[URL="http://www.mysql.com/products/connector/j/"] MySQL Connector J[/URL], a type 4 / pure JDBC compliant driver. Make sure you add this driver to your runtime dependency and you are good to go. | |
Re: > I have tried my level best to complete the project within 2 months but I am not able to do > that. Maybe you looked in the wrong places; the internet is choke full of resources which can help you complete almost every school level project. You just need … | |
Re: And replacing the [ICODE]onclick [/ICODE]with [ICODE]onmouseover [/ICODE]doesn't seem to work? | |
Re: No matter what kind of tutorials you read, learning from a good book is almost always irreplaceable. For JSP/Servlets, Head First Servlets and JSP is a good choice IMO. | |
Re: Start off with the [URL="http://java.sun.com/javaee/reference/"]Sun J2EE tutorials[/URL] which cover almost everything you need to complete this project along with a lot of sample code. | |
Re: > You can't use getElementById to access elements added by a script. Bosh. Please verify the facts before stating something. [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv"Script-Content-Type" content="text/javascript"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Expires" content="0"> <!-- disable caching --> <title>Example</title> <script type="text/javascript"> function addElem(frm) { … | |
Re: So what seems to be the problem? Which method are you currently using for shipping data to-and-fro? XML, JSON or plain text? AFAIK, refreshing (updating) two DIV's shouldn't be very much different than refreshing a single DIV except for the way in which you request / handle the two new … | |
Re: How about showing us your effort or what you have achieved so far considering that we have a forum policy to not give out free code snippets? Also, please don't forget to read the forum rules and use code tags when posting code. | |
Re: Initially attach a styleclass to all the links on your page which will keep them hidden using the [ICODE]display [/ICODE] / [ICODE]visibility[/ICODE] CSS property. Attach an event handler to the [ICODE]onload [/ICODE]event listener which would make these links visible only after the entire page has loaded, by virtue of the … | |
Re: I really don't mind them since I rarely hover on a thread to preview it. But on rare times when those things pop up, they are a little bit distracting; maybe because I am not used to them. | |
Re: The snippet as such doesn't seem to reek of any bugs so your best bet would be to look at the place where [ICODE]usrPass[/ICODE] actually originates. Maybe it's the way you are accepting user input which is causing it to trim whitespaces. One minor point; instead of [ICODE]passCh == ' … | |
Re: Where is the definition of the empty() function? It would be better if you posted a working copy of your code which we can directly use for testing your example rather than trying to figure out what seems to be wrong in the small snippet presented to us. | |
Re: > How can I fill the content with ajax responseText ONLY after the page structure has been fully > loaded? Attach a listener (function) to the onload event handler which would load all the values using Ajax requests only after the page has been loaded. > is it matters if … | |
Re: You seem to be in serious need of some good [URL="http://www.jibbering.com/faq/faq_notes/form_access.html#faInF"]Javascript tutorials[/URL]. First of all, Javascript is case sensitive, hence [icode]selectedindex[/icode] is not the same as [icode]selectedIndex[/icode]. Also, the values of form controls are always of type string, so checking a textbox value for 0 seems pointless enough. It should … | |
Re: To get around these scope issues, you can either go with the messier and error prone global object solution or make use of the elegant concept of Closures. [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv"Script-Content-Type" content="text/javascript"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Expires" content="0"> <!-- disable … | |
Re: > my project uses JSF. JSF projects require a configuration file which goes by the name of faces-config.xml along with an entry of FacesServlet in the web.xml which does the actual processing of the JSF pages. You need to take care of these things when deploying a JSF app; but … | |
Re: > Ok...when i change the line this.value = this.dummy(value) to this.value = > this.prototype.dummy(value) the code runs. Are you sure this works, because IMO it shouldn't. Try to instantiate your object in a normal manner and see this line blow up. The [ICODE]prototype [/ICODE]property of the object is not the … | |
Re: You are doing a [ICODE]getElementById()[/ICODE] for "I1" but there is no element which goes by the ID "I1"; you only have an [ICODE]IFRAME [/ICODE]with a [ICODE]name [/ICODE]attribute of "I1". IE is infamous for allowing such things to slip by. If a call to [ICODE]getElementById()[/ICODE] returns [ICODE]null[/ICODE], it looks for an … | |
Re: Forward won't work given that the requested servlet is looked for in the given ServletContext. [icode]sendRedirect[/icode] doesn't preserve the original request since it's a new request altogether which the client is making -- [icode]sendRedirect[/icode] is basically an indication to the client to request for the given URI. | |
Re: Just follow the golden rule of never using TABS in your source code along with following the 70/80 column limit by using good source code formatters and you should be good to go without having to rely on which algorithm is used to format/render your code. | |
Re: Maybe something along the lines of this (untested) [code] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv"Script-Content-Type" content="text/javascript"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Expires" content="0"> <!-- disable caching --> <title>Example</title> <script type="text/javascript"> timerHandle = null; value = null; function showPress(val) { // Set the global variable 'value' … | |
Re: > images[0] = new image(); [icode]images[0] = new Image();[/icode] | |
Re: It is a bit fuzzy as to what you are trying to do here but as far as I can see, you need some way of automating the data which adds markers to the Javascript 'map' object on the fly by reading in data from some external XML file. One … | |
Re: You can always make two server trips and pull the required information one at a time. Another way would be to use JSON to pull in data in a single server trip by sending the data in the form: [icode]{ city: ['C1', 'C2', 'C3'], state: ['S1', 'S2', 'S3'] }[/icode] and … | |
Re: IMO going all the way to convert tabs into spaces using some intelligent algorithm is way too much trouble than it's worth. It is basically the responsibility of the programmer posting the code to make sure that all tabs are converted to spaces and to follow the 80 column width … | |
Re: > i dont know whether its to do with this, or a load of hotfixes i installed, but windows mobile > PDAs no longer crash when displaying threads It's the Hot fixes you installed, not Javascript. |
The End.