Hi I need some help understanding this code:
It works well but can someone add some comments to help me understand it better?
Thanks
Here's the code:
function contractall() {
if (document.getElementById) {
var inc = 0
while (document.getElementById("dropmsg" + inc)) {
document.getElementById("dropmsg" +...
$('#element').method();
or
var element = $('#element');
element.method();
...
I am creating a composite control, that implements IScriptControl.
in CreateChildControls() function i have this:
HtmlGenericControl ul = new HtmlGenericControl("ul");
HtmlGenericControl b2 = new HtmlGenericControl("li");
b2.Style["background-image"] = string.Format("url({0})", imageSrc);
b2.Style["list-style"] = "none";
b...
Hi! I want to find out the difference between two Dates (in terms of minutes) appearing in two different elements as data in my XML file using XSLT. I can't use functions for this, as I am using visual studio 2008, in version 1.0 XSLT functions are not supported ..
Ex- 11/12/2009 12:00 AM 12/01/2010 12:00 PM And also I have to see that...
I have a DIV that has plenty of child DIVs inside of it. What I want is similar to Firefox's tabs, when you have too many tabs open or the main DIV width is too small, the interface will detect overflow and show a button on the right side to list all hidden tabs. The problem is that I have no idea where to even start looking for help.
...
I'm writing a simple game with javascript/html5, and I'm trying to implement "gravity".
The code I have is sort of like this:
gravity = 4;
acceleration = 1.1;
function gameLoop(){
gravity = gravity*acceleration;
if (characterPositionY < 600)
characterPositionY = characterPositionY + gravity;
setTimeout(gameLoop,1000/30);...
Hello, I want to get an extension (or HTTP headers received) and base64-encoded (seems like JS doesn't have a built-in encoding function, so "binary" would be ok too) body of an image on a page. How can I do it?
This probably seems to be a weird action, but I really need to do it this way: I have a browser object and want to get such da...
Can someone give me a simple example of a AnnotatedTimeLine visualization? All the examples I can find have only one line, despite the docs talking about multiple lines.
Adn if you're feeling particularly kind, you might give me an example of what a (python) datasource schema looks like for the example.
Thanks in advance.
...
Hello
I want to check if a string contains only digits. I used this:
var isANumber = isNaN(theValue) === false;
if (isANumber){
..
}
.. but realized that it also allows + and -. Basically I wanna make sure the input contains ONLY digits and no other letters. Since +100 and -5 are both numbers, isNaN, is not the right way to go.
...
How to open 2 different link one in same window and another one in new window from one link? I want to open one link in parent window and other one in new window not new tab in all A-Grade browsers
...
Hello everybody.
I have a problem with some basic ajax and asp.net web service. In my website page i have a text box that is reach text editor, when i put text and try to submit it, ajax supposed to take the text and pass it to asp.net web service. When the sentence contains no escape characters it goes well, however when it does contai...
On mootools I'm used to declare once and reuse often. An FX example would go like this:
myEffect1 = new Fx.Slide($('myElement1'));
How should I go on jQuery? Meaning, the docs make it straightfoward to use:
$('myElement1').click(function(e){
this.slideToggle();
});
But if I want to call this effect somewhere else on my code wil...
Hello,
I am writing a Javascript dialog script which is seen in a lot of typical Role Playing Games.
At the moment I got an array with text strings which you can skip trough. I got at the point where you can make a decision and based on the input a different string will show.
However I don't think this is the right way to do it. These...
Hi, I am trying to use regular expession in javascript but it is not working. My custom control contains property called RegEx which is provided by user and I need to validate the input value against this regex. As properties in JS will be in double quotes("") the regualr expression fails(case -1). Case 2 succeeds thought both the cases ...
I need to know if there is any way of writing additional code to JavaScript files already deployed on the server.
I am facing a problem with an ASP.NET 2.0 website and it is related to the JavaScript files which I have on some of the pages. The problem is that when I upload the JavaScript files along with other files it works fine, but...
When clicking on each div it should alert '1' if div 1 was clicked on or '5' if div 2 was clicked on. I have tried to make this code as easy to as possible because this is needed in a much larger application.
<html>
<head>
<style type="text/css">
#div1 { background-color: #00ff00; margin: 10px; padding: 10px; }
#div2 { background-color:...
In nodejs, the only way to execute external commands is via sys.exec(cmd). I'd like to call an external command and give it data via stdin. In nodejs there does yet not appear to be a way to open a command and then push data to it (only to exec and receive its standard+error outputs), so it appears the only way I've got to do this right ...
Well not just IE, any browser that doesn't currently support it
I want to start using the processing.js framework. It's used for making images with the canvas element. However I'm reluctant to use it due to the fact that it's not widely supported.
So what's the best way for me to give the user an alternative image if they do not suppor...
I'm currently coding a button which will delete a record from a database if clicked. However, I want some sort of confirmation after they click it so there are no accidents. I was imagining a popup box that tells them they are about to delete this record with two buttons cancel and OK. If cancelled, nothing happens, but if OK is pressed,...
Hi
So I'm a newbie at this sort of thing - I just started developing with CodeIgniter and I'm trying to integrate javascript libraries. However, I have my .htaccess set up so that all requests get /index.php/ tacked in front of it, which makes it difficult to include files. For CSS I just use a php include to get around this problem and...