3,892 Posted Topics
Re: [URL="http://developer.mozilla.org/en/docs/DOM:window.setTimeout"]setTimeout [/URL]executes a given piece of code / a function after a given amount of time, though not repeatedly. For that, there is always [URL="http://developer.mozilla.org/en/docs/DOM:window.setInterval"]setInterval[/URL]. | |
Re: > I've come up with a solution and now I'm addressing the issue of mozilla and ie rendering > different results on getYear. [URL="http://www.quirksmode.org/js/introdate.html"]Linky[/URL] | |
Re: [quote=Ancient Dragon;295750]Nothing wrong with it, its just that nobody outside educational instutions use it.[/quote] Not completely true. Though Lisp has come to a stage where its name is not heard in the mainstream software senario like that of Python or C# or Java, but its still out there, live and … | |
Re: Try using [URL="http://tuckey.org/urlrewrite/"]UrlRewriteFilter [/URL]for serious uses or using a servlet for controller and making appropriate entry in the [ICODE]web.xml[/ICODE] file. With URLRewrite it would be something along the lines of: [code] <rule> <from>^/products/([0-9]+)$</from> <to>/products/index.jsp?product_id=$1</to> </rule>[/code] For e.g. suppose you have a controller which handles the application flow, the web.xml would … | |
Re: > even null is not equal to null [code]window.alert(null === null);[/code] There ya go! | |
Re: Yes, the concept seems to be useful, at least for those who are new to forum based systems though the downside here is that regular posters will have to go through an extra click to post their replies. | |
Re: > Note that setSize() is not a member of ConfirmExitDialog() but inherited from a super > class... now "this" is used to access it??? [ICODE]this [/ICODE]simply stands for the reference to current instance in consideration. The execution of setSize() is no different than [ICODE]this.setSize()[/ICODE] for the very same reason. They … | |
Re: Using normal HTML with embedded JSP tags. Take a look at the generated HTML markup by JSF and you will get a fair idea of how things are rendered under the hood. | |
Re: [code]> document.getElementById("ContactFormDiv").insertBefore(loadingImg, ContactForm); [/code] Where have you defined ContactForm? | |
Re: > So much nicer if data would be retrieved from DB in servlet, Not to mention that actually *nothing* should go in servlet except the processing of request parameters / attributes and invocation of the actual business logic components. This helps in ensuring that you don't repeat yourself when the … | |
Re: Google for Ajax date picker. | |
Re: > If not, why haven't developers pushed to have such an object created Pop-ups are a usability concern and are almost always handed by different browsers and specialized pop-up blockers in different ways. What would you gain from detecting whether pop-ups are blocked or not? If navigate the user to … | |
Re: > I really like the idea of pieces not being capable of moving but knowing their legal moves. I am yet to see a game where the pieces don't move. Each and every piece is capable of moving though the set of legal moves differ from game to game. IMO, … | |
Re: Your best bet would be to intercept the point in the data flow which is causing this behavior. Before sending the Ajax request, do an alert and see whether is it an issue with the data being passed to the server. Try logging the data received at the server to … | |
Re: > is not standard function avoid to use this. On the contrary, [URL="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-71555259"]it is.[/URL] | |
Re: This bug has already been brought up in the Mod section with still no reply. Maybe solving that thread will solve this one too. | |
Re: Javascript has variables, no? You can use them to maintain the state of your calculator app. | |
Re: > I've been banging my head against the wall all week on this, and I don't think I have much > skull left! Here, I will put you out of your misery. :-) Anyways, the bug in the program is pretty apparent here given that you make use of global … | |
Re: AFAIK, there is no reliable way of capturing the page unload event hence not possible. The maximum you can do is come up with some browser specific mumbo jumbo which would surely fail in other browsers. The only reliable way is to keep sending postbacks to the server using Ajax … | |
Re: > Add a counter pause/unpause button. Set a Javascript variable which would be checked before invoking your countdown function. As soon as the 'Pause' button is clicked, set the flag variable, store the state of your counter variables and clear the timeout. As soon as the 'UnPause' button is clicked, … | |
Re: A solution has already been suggested to you. Move the dynamically generated Javascript out of the looping construct. To understand more, take a look at the generated source code by navigating to 'View' -> 'View Source' in Firefox. | |
Re: > concentrate on eval() function in javascript by googling As in concentrate on swatting a fly with a hammer? [ICODE]eval [/ICODE]sort of fires off a mini-compiler which dynamically evaluates the string passed to it. Look for better ways of doing things and use [ICODE]eval [/ICODE]only when required. E.g. when evaluating … | |
Re: Glassfish is a full fledged application server while Tomcat is just a servlet container. The choice of which to use depends on your purpose of using the same. | |
Re: > unable to swap images using arrays in javascript Not surprising considering that the [ICODE]marquee [/ICODE]tag is non-standard, deprecated and has no [ICODE]onclick [/ICODE]attribute. | |
Re: ...or just look at the Error Console in Firefox to get the most out of the goodies provided out-of-the-box with your browser. If you still can't pinpoint the cause, step by step debug using Firebug is the way to go. | |
Re: If you are pulling data from the server on fly using Ajax, you can't use events like [ICODE]onload [/ICODE]since there is as such no page refresh / loading happening here. This is the very reason why the dynamic content can't be seen in the static source. To view the modified … | |
Re: I doubt the above code would even work in FF2 considering that you explicitly need to pass the event when registering the handler. [code]<a href="#" onclick="doSomething(event);">[/code] | |
![]() | |
Re: [URL="http://www.daniweb.com/forums/showpost.php?p=646185&postcount=13"]The One?[/URL] | |
Re: A simple script like this should do the job. Do keep it mind that it can be made better in a lot of ways but for your purpose it should serve well enough: [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"> … | |
Re: Firefox comes with an excellent debugging utility called Firebug which you can put to your use in this case. Also, the problem might lie in the code which changes the [ICODE]INPUT [/ICODE]element to [ICODE]SELECT[/ICODE]. How are you making the switch? Are you removing the old element and adding a new … | |
Re: Firefox comes with a pre-packaged feature called Error Console (Tools -> Error Console) which highlights all the Javascript errors on your web page. You can also grab hold of Firebug, an advanced Javascript debugging utility which is a Firefox plugin. | |
Re: Look into HTML DOM classes [URL="http://www.w3schools.com/HTMLDOM/dom_obj_table.asp"]Table, TableCell and TableRow[/URL]. | |
Re: Also make sure you completely understand the implications of storing the contents of the entire file in a StringBuilder instance since this technique might just result in the entire file contents being loaded in memory which becomes a big issue for huge text files. Consider using a buffer which reads … | |
Re: > Error: document.getElementById(treeid) has no properties It simply means that no such object with the ID as 'treeid' (or if 'treeid' is a variable, then the value 'treeid' holds) exists in the document tree. | |
Re: Maybe something like this snippet will help you getting started. Ensure that the elements you are trying to access are form fields enclosed in the form tag. [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"> <title>Example</title> <script type="text/javascript"> /** * A placeholder … | |
Re: You seem to be thoroughly confused there. Firstly, HTML is a markup language and used as a presentation layer technology. You don't connect to databases using HTML; you need a general purpose programming language like C/C++/Java/Ruby/Python to connect to databases. Google for 'HTML Tutorial' and start reading... | |
Re: > This would probably make your life a bit easier. And learning Java a bit tougher... | |
Re: > Can anyone help? Yes, only if you first post your attempt. If you are new to Javascript, start by googling Javascript tutorials and then giving it a try. | |
Re: And how is it different from dynamically writing out JavaScript which developers have been using for times unknown? Plus Ajax is a different beast altogether dealing with shipping data to and fro *after* the entire page has been loaded in a manner which doesn't force a browser refresh. So yeah, … | |
Re: Put in simple terms, both are comparison operators of Javascript with the difference being that === is a type safe / type aware operator. If two operands are of the same type and same value, only then the === returns true. Whereas, in case of == if the two operands … | |
Re: Look into [ICODE]window.open[/ICODE] and [ICODE]window.onload[/ICODE] for achieving your objective. | |
Re: > Is javascript the way to go with this? No, AFAIK it can't be done in Javascript irrespective of whether the PDF's are pre-generated / generated on fly. The way to do it would be process the user input at the server and set the response headers accordingly when the … | |
Re: [URL="http://www.dynamicdrive.com/dynamicindex1/contextmenu.htm"]Custom Context menus for IE and FF.[/URL] | |
Re: > i want my email field to be validated such that a user can enter only valid email id...how > should i do this? This check can't be reliably done at client side considering that there are a lot of valid email formats. For e.g. mail provider A might not … | |
Re: Use the [URL="http://www.json.org/java/"]Java binding for JSON[/URL]. Its pretty simple and after your JSON object has been constructed, all you have to do is store the representation in a String variable which can be accessed by your JSP; i.e. the normal way in which you pass data to and fro from … | |
Re: > But when I click on Next link, I get "The requested resource (/getReleaseData) is not > available.". Take a look at the link which is displayed in the location bar of your web browser. Is path shown there same as that the location at which your servlet is present? | |
Re: The RegExp you have there is incorrect. The correct one would be: [code] /* For Letters: [a-zA-Z] (dealing with both upper and lower case characters) For Space: [ ] Putting them together: [a-zA-Z ]+ Use a + instead of * since a blank string is not a valid letter nor … | |
| |
Re: > Then create a method in the class that loops the two arrays and checks one by one the > elements. Or just use the one provided by the standard library for the [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Arrays.html"]Arrays[/URL] class. If comparing two Object arrays, use the [ICODE]Arrays.deepEquals(Object[] a1, Object[] a2) [/ICODE]. When comparing arrays … |
The End.