javascript

how to create hyperlink in piechart

Hi guys! I want to do a pie chart in matplotlib. This pie chart will be a representation of two variables: male and female. That's easy to do :) What I would like to do next, I'm not even sure if it's possible to do with matplotlib, I would like to make these two variables clickable so if I click on male, I would see another page with...

Split pane using CSS3 Resize property

Hello, I've been trying to do split pane resizing using the CSS3 property. Here is the code: <style> div.left, div.right {float: left; outline: solid 1px #ccc; resize: both; overflow: auto;} div.left {width: 20%} div.right {width: 80%} </style> <div class="left"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </div>...

Syntax explanation please

Hi, I'm trying to understand 2 different lines of code below. My javascript is weak, trying to improve it with jquery (hmmmm) What I'm trying to use the drag sort plugin from http://dragsort.codeplex.com/ specifically I'm using the http://dragsort.codeplex.com/SourceControl/changeset/view/74794#1025059 example. I've gotten to the sta...

Including other libraries / files / plugins with nodejs and NPM

I'm using OSX 10.5 and playing around with Nodejs. I've managed to install npm and used it to install a couple of plugins. Well at least the installation says it has worked fine but when I try and load them in I get an error $npm install htmlparser Installs ok, then I create a file called test with var htmlparser = require("node-htm...

Execute a function on click

Hello, I have the script below which works well, i.e. it generates a chart on the screen when the page loads: <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChartAjax); function drawChartAjax() { $.ajax({ url: 'json_data.aspx', ...

How to use multiple jQuery Plugins in one File

How to use multiple jQuery Plugins in one File? I have to use jcarasoul and Lightbox plugin both together in a file of php. the Jcarasoul is working fine for the light box all paths are correct but it always says that $("#gallery a").lightbox is not a funtion. Same as for fancy box or how do I can use Lightbox2 of prototype with jQue...

Split a string on a pattern

var a="##55##data1!!##66##data4545!!##77##data44!!"; how to remove ##664545##data!! from the string Edit:if we know the start value in a string i.e,##66## and the end value ie,!! In the main string how to remove characters starting from the start pattern,data after the start pattern till the end pattern My expected output w...

JavaScript: Get clicked element.

Hi all, I need to get clicked element in function getClickedElement. How can I do this? <html> <head> <script> function getClickedElement () { } </script> </head> <body> <a href="javascript:alert(getClickedElement())" id="test">click me!!!</a> </body> </html> I can set only href attribute. I can not set onclick event be...

JQuery and JqGrid retrieve data from row

Hi, How I can retrieve data from jqgrid row, if I have only the number of the row? For example what I have to do if I want the id column of the 3th row? Thanks a lot. MP ...

Which programming language should I use for TCP server for JavaScript clients?

Hi, I am asking for advise on which programming language is most acceptable for the following situation. The program will act as the server in a TCP networking application, serving JavaScript clients that output to the browser, using a pre-written framework. The server program will need to be 'always-on', and be capable of dealing wit...

Javascript pattern matching

In a string if we know a start point .how to find the end string using js or jquery var helper="$var_1__ee$var_2__ee"; $var is the starting point and the end string pattern is ee How to split the string based on this pattern ...

Add rounded corners to a rectangle raster image

What is the best way to make something like a mask with rounded corners for an image using CSS/JS/HTML? So, I need to add rounded corners to a rectangle image. I thought about adding 4 graphic elements like this one above the image at its corners to hide some little parts of the image. Here red color is, for example, for using on the re...

array in javascript

i have a piece of code like below var abc = { 2: {label: "raju"}, 10: {label: "samu"}, 3: {label: "sidh"}, 1: {label: "kat"}, }; for(var i in abc){ alert(i); } in mozilla fire fox it alerts 2,10,3,1. but in chrome it shows 1,2,3,10 but my requirement is the first one (as shown in fire fox) what to do for getting the same resul...

how to convert number to string (without exponent)

hey there! sorry, but i'm not that maths guy, so i do not know how it is really called: number 12345678901234567890123 could be also stated as 1.2345678901234567890123 * 10^22 (if i'm right and did not miss any decimal...) consider this javascript: var number = 12345678901234567890123; var stringValue = number.toString(); if i do s...

Permission error when using Ajax on a protocol other than http

Hello, We are using a custom protocol handler to connect to an embedded device across firewalls, NAT etc. The solution is called Nabto. This works great - a plug-in on the user's computer handles requests to all nabto:// URIs and serves HTML pages with information about the current connections etc. Now, we would like to access Nabto fu...

.keypress on a DIV tag ??

Is there a way to get work .keypress on a div element like this?: <html> <body> <script type="text/javascript"> <!-- $('#idtext').keypress(function(event) { var keyCode = event.keyCode; $('#idtext').text(function(i, text) { return text + String.fromCharCode(keyCode); }); }); // --> </script> <div id="idtext"></div> </b...

Javascript: How can I delay returning a value for img.complete

I've written a script to test for SVG support in the IMG tag: function SVGinIMG() { var SVGdata = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNzUiIGhlaWdodD0iMjc1Ij48L3N2Zz4%3D' var i = document.createElement('img'); i.setAttribute('src',SVGdata); return i.complete; } window.onload ...

how to make url enable and disable for a particular id using php

Hi All, I hope someone in here can help me out because I am a bit confused right now! I have searched everywhere for solutions on this issue but cant find anything... The question: I would like to show a specific "div" when and only when visitors are on the particular game is selected. eg: http://www.xyz.com/play.php?id=1234 If visit...

is there a shorter way for this condition?

if (form.a.value !=""&&form.b.value!="" &&form.c.value !="") is there a shorter way for this condition? ...

append.html jquery is not working the same as the existing html?

i have a situation where im apending html to load more posts(pagination), and each post has a reply link, the appened html is not functioning properly: the jquery post: $(function() { //More Button $('.more').live("click",function() { var ID = $(this).attr("id"); if(ID) { $("#more"+ID).html('<img src="moreajax.gif" />'); $.ajax({ typ...