Skip to content
Advertisement

Tag: javascript

Can anyone explain me what is state and mutable data?

In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. http://en.wikipedia.org/wiki/Functional_programming Can anyone explain me what is state and mutable data? Can anyone give me examples in either JAVA or JavaScript. Answer mutable suggest anything that can change, i.e. an int In java a string is

How to match any combination of letters using regex?

How can I match letters a,b,c once in any combination and varying length like this: The expression should match these cases: but should not match these ones: Answer Use regex pattern You can use this pattern with any set and size, just replace [abc] with desired set… Example: (above output is from myregextester)

Java applets – is it a wrong choice today?

I have some non-trivial computational code that need to be applied on data already downloaded into the browser DOM and captured from user interactions. I do not wish to expose this code. I am wondering if: Write a webservice and communicate with the browser over websocket or HTTP. The trade-off is speed of interaction (from slick to poor) and higher

How do I pass JavaScript values to Scriptlet in JSP?

Can anyone tell me how to pass JavaScript values to Scriptlet in JSP? Answer Your javascript values are client-side, your scriptlet is running server-side. So if you want to use your javascript variables in a scriptlet, you will need to submit them. To achieve this, either store them in input fields and submit a form, or perform an ajax request.

In GWT, How can I get all attributes of an element in the HTML DOM?

I can’t see any method on the com.google.gwt.dom.client.Element class that allows me to get all attributes of an element node. Have I missed anything? Presumably I can get the attributes array of the underlying Javascript object by dropping into native code? I know the results are browser-dependent, but there seem to be known workarounds for that. I haven’t dived much

Download and open PDF file using Ajax

I have an action class that generates a PDF. The contentType is set appropriately. I call this action through an Ajax call. I don’t know the way to deliver this stream to browser. I tried a few things but nothing worked. The above gives the error: Your browser sent a request that this server could not understand. Answer You don’t

Advertisement