javascript

Javascript If Else nesting

Hello here is my code : var one = 0; var two = 0; var three = 0; var free = 1; function open() { if ($('#one').is(':visible')) { one = 1; } else { one = 0; free = 1; } if ($('#two').is(':visible')) { two = 1; } else { two = 0; if (one == 1) ...

Passing canvas data through ajax

Hi, I have an application to save the canvas data instantaneously to server. My requirement is to export the canvas data on every second, save it to the server through ajax and import the same data to another canvas in another browser through ajax. I am using Jquery for ajax. I used the following code to pass the data function sendCan...

Will including javascript files from googles site slow my load time?

so im trying to include this file for an application http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js would including it as this url slow the load time of my site when using an application that requires it? as opposed to downloading this file and including it locally ...

how to do a javascript validation in joomla backend

Hi all, How to do a java script validation in joomla. thanks in advance for guidance. ...

Probelm in using google font apis

Hi all, I am working on a web application using SVG. The plan is to use the Google Webfonts APIs to let the user choose their font type and then have their name rendered in SVG. The problem is that when I use the Google APIs to access the fonts, it does not work (reverts back to Serif font). However, when I download the Google fonts an...

what is the best js drag and drop framework ?

i need to build diagram builder in js to be cross browser , what do you think will be the best light drag and drop frame work ? ...

How to dynamically populate options on dropdown lists based on selection in another dropdown?

Hi everyone, I have a table which has the information of a category, say a product. I have listed them in a dropdown menu. Now, what I need to do is, list the sub category of the selected category in a next dropdown menu. I hope, javascript is required, but I am not that familiar with javascript yet. Would be much thankful for the help...

JSpec no longer supported?

Coming from the Ruby community I'm looking for a BDD-testing framework for Javascript/Node.js. I was JSpec and thought it would be the right choice because I used RSpec in Ruby. But on their GitHub page http://github.com/visionmedia/jspec it says it's no longer supported. They are abandoning this project? Does this mean I shouldn't u...

javascript : displaying sixth element even its not there in an array.

i have 5 elements in my array & in my html there are six div's when the loop goes for sixth element and the corresponding element is not present in the array, then the div should be hidden otherwise it should be visible The problem i am facing with my current code is that even sixth element is not there, it is showing div as visible, ...

making jQuery code static for different pages

Hello, I am trying to use the jQuery Countown plugin to let my users now how much time they have left for a certain task. So I use the following code to start the countdown with 30 minutes. <script type="text/javascript"> $(function () { $('#defaultCountdown').countdown({until: '+30m'}); }); </script> The problem is that the users ...

cross browsing problem in ajax call.

When i execute it in firefox mozila than this code is working well (in case of register user) but when we try it in IE (iternet explorer 8) then alert("sorry u must have to login first"); this message is comming. ( in both cases as register or gest). Another thing: for gest user returning data from server is null. means d = null, Ano...

Conditional call based on JSON data

hi, I am trying to modify my Javascript page, which uses Ext Js library.(I don't have any idea about ext js, haven't worked on it either) What I want To do is that based on the JSON DATA particularly the field "successProperty", I want to decide whether to upload the grid or give an alert. What I can possibly do is to add an event to ...

JavaScript object literal syntax

If the syntax for JavaScript object literals is { label: value, label: value, ... } then why is it that I've seen some people use this in their code? {window} What is its purpose? I've tried that and it evaluates to window as it would without the braces. It doesn't even fit in with the object literal notation. Is it a code block? ...

Can I inject google AJAX API autoload anywhere else than globally?

Hi, There is this issue I am struggling with. I know that the autoload for the google visualization geomap must be in the part of your document. The thing is every time I reload some other pages in my application the google reloads everything and this I want to take out. So I tried taking the : <script type="text/javascript" src="htt...

Global method for setting a wait cursor when POSTing or GETting web pages?

We have a web application that is well established and has a few hundred screens. Some clients on slow connections are annoyed that when they submit a page, or when a page is loading, there's no indication that anything is happening (the cursor just remains a pointer). This particularly seems to be an issue on Firefox ... which NEVER s...

Converting string to E4X XML using Javascript

Using E4X, i can easily access nodes in XML using javascript as follows: <script language="javascript"> xmldata = <books><book><title>AA</title></book></books>; // notice the no string quotes alert(xmldata.book.title); </script> However, the application returning the data to me is returning XML as string. How can i access using this...

Find out relative urls in javascript

I want to know if the url is relative or no using javascript. Basically i will be passed the url, if the url is relative append the current url i.e minus the file name. Can some one help me with this eg:- CURRENT URL = http://example.com/big/index.html PASSED URL 1 = newindex.html OUTPUT = http://example.com/big/newindex.h...

jquery tabs selection

the jquery code is like this: $(document).ready(function() { //When page loads... $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function() { ...

jquery visibility selector

I'd like to know if there's anything incorrect in the following : if($('#three').is(':visible')) { alert("visible"); } else { alert("hidden"); } Thanks ...

HowTo use javascript with parameters in Altova StyleVision

I'm trying to include a javascript with two paramters in Altova SytleVision, but in every example I find the javascripts do not use any parameters. I'm lost on how to define/use parameters in this tool with javascript. ...