javascript

dynamic script loader in JS

How can i write dynamic MULTIPLE script loader with complete handler like google google.load("http://script1"); google.load("http://script2"); google.setOnLoadCallback(function(){}); thanks ...

How to copy text from one div to another in javascript

I have div1 and div2, upon clicking copy button I want the text in div1 copied to div2, how is it possible in javascript, pls help. ...

Dumb question, I hope - how to get javascript files reference by .NET themes?

I have in my C#, .NET 3.5 (VS2008) web project's App_Themes directory a theme directory called Theme1. In that directory I have various other directories. Some of theme contain .css files and some contain .js files. In my web pages, which use this theme, the appropriate link tags are rendered, in the HTML, for the .css files, but not the...

How can i parseFloat a php var inside javascript

I need to parseFloat this then to replace the dot with a comma: sum="<?php echo substr($_tarif_membre,0,-2).'.'.substr($_tarif_membre,-2,2) ?>" * $('#tarif_membre').val() total_total= sum.replace('.',',') $('#total_total').val(sum) if i dont multiply the php echoed variable by $('#tarif_membre').val() it will still show the result a...

Rotating an image in canvas and keeping it draggable

I have an image that I draw on a canvas. When the mouse clicks and drags I get the mouse coordinates and use them to set the positionX and Y of the image. After that's been done I redraw the canvas. That works like a charm and I can move the image over the canvas. But now I make 2 buttons so I can rotate the image left and right. When I...

why do we need to calculate time from year 1970?

In most of the Programming or scripting language such as PHP or JavaScript, i have come across the time function which tends to calculate the time from year 1970. for example in javascript if i use the function getTime() or in PHP the time() it returns an integer value. In PHP. the code with <?php echo time(); ?> returns an integer v...

How do I create a zoom in/zoom out feature like in Google Maps

I want to create a web based tool that allows people to visualise semantic web ontologies. The visualisation will look like a tree structure. I want people to be able to zoom in and zoom out the way they can with Google Maps, to get a close look to make a selection or to get a overview of the main topics etc. Can you provide some pointe...

JavaScript key handling and browser compatibility

Hi, I'm working on key handling in java script. I have done some research and I'd like to know whether I have a correct understanding of key handling. KeyDown/KeyUp Event The key down and key up events are supported by IE7+ and Firefox 3.5+ I didn't check the earlier versions of the browsers, but I guess that they also support these ev...

Correcting the sliding animation of a custom carousel

I'll even share my code with you! Basically, I have a carousel that I built from the bottom up - Now, it works fine when there is more than one product being shown. When there is only one product shown, then the animation jumps in IE (surprise...). Anyone have and idea how I could fix this up? My jQuery for the sliding: $(leftButton)...

Google AJAX Feed API, Dynamic Feed Control and the Japnese Language

English is fine but for Japanese feeds its showing invalid characters... why i am getting invalid characters in Japnese feeds? http://acsjapan.jp/j/index.html not in english? http://acsjapan.jp/ help me fix for japnese feeds.. ...

how to know if a field exist inside an object? (as in javascript)

And ofcourse I want to do this code-wise. It's not that there isn't alternative to this problem I'm facing, just currious. ...

Facebook - Jscript in address bar safe?

I got this in my Facebook messages telling me to paste this in my address bar to help them get some item in some game. Of course I didn't do it yet, but is this okay to do? Did my friend catch a virus or is this actually part of the game? If not, what does this actually do? Thanks for any help in advance. //Note: Don't Try This Yourself...

Flot Stacked Bar Chart and displaying bar values on mouse over

Hi, I'm trying to understand the tooltip functionality of Flot but not really getting my head around it! I am trying to achieve a tooltip that displays the label and value of each section of a stacked bar chart Would someone be able to point my towards an example of this or provide code for doing so? ...

Print a website without printing the link locations?

Hello, I'm invoking the navigator print function using a simple window.print(); call. It prints perfect (I want to print the same I see on the screen, so I don't really use a special CSS to print) but it showing the link locations next to the text link, something like: Homepage (http://localhost) To be clearer: I don't want to h...

Long delay [~1s] between browser attempting to connect and Socket.Accept()

Overview of the problem: I've been playing with writing custom http server apps for a while now. I found out that when any web browser connected to my server app, there would be a 0.5-1 second "latency" (according to Google Chrome), before the request was handled [which would take milliseconds] I eventually tried to make a dummy progra...

It is possible that calling asp.net function as being used javascript codes?

Forinstance there is a asp.net function. I want to run that function from javascript codes. is this possible ? if it is , how? ...

Rotate along Z- axis in HTML5 - Flip card

Hi All, I just came across a simple flash animation on flip card The Playing Card Effect The card has 2 images "front" image and "back" image, when clicked the card toggles with rotating along Z axis showing the front and back face accordingly. Can the same effect be achieved using HTML5 / Canvas / CSS3 ?? PS: I'm complete newbie/noob...

Why does the value attribute of a button have specified = false in IE?

I have been looking for an elegant solution to converting a submit button to a button. In Internet Explorer you cannot simply change the type of an input. I couldn't change the attribute on a clone of the object either, so I thought I would manually duplicate it by creating a new object and then iterate through the attributes of the subm...

Javascript Function instance is automatically casted to object and can't be called anymore

Hi, I'm working with a fairly complex Javascript program wich, at a given point, returns some nested anonymous functions. Sometimes, when I try to "apply" one of such anonymous functions ("f" in this example)... f.apply (this.context, args) ...I get an "f.apply is not a function" error. It's weird, because alert(f) displays the fun...

Algorithm to get changes between two arrays

I needed to create an algorithm which will (efficiently) take an old array and a new array and give me back the changes between the two (which items added, which removed). It happens to need to be in JavaScript (to run in the browser) but the algorithm's more important than the language. This is what I came up with: http://jsbin.com/ose...