javascript

dojo toolkit question about loading the base dojo.js file

I am getting used to the dojo toolkit. So my question is does the following code mean to load the base dojo code? var djConfig = { baseScriptUri: "js/dojo/" }; Would I use the following code if I am using a CDN? var djConfig = { baseScriptUri: "http://o.aolcdn.com/dojo/" }; or would I write the code this way...

Jquery DIV count

Hi Folks, I am trying to count the number of elements under a parent but its giving me an incorrect count. The result should be 2, where as its returning me 4. My HTML structure is: <div style="overflow: hidden;" id="parentDiv" class="scroll"> <div id="3"> <table id="t3" class="Table"> <tbody> <tr> <td ...

On Mouse Click call Key Event + JavaScript

Hi all, I wonna to create a Link and if you click on if it call a js script witch calls a Key combination CTRL+/ or CRTL+- thx ...

Javascript slow-load technique

Hi, I'm trying to learn all i can about the slow load technique (as described here: http://www.obviously.com/tech_tips/slow_load_technique) in javascript, for making near-realtime chat applications and the like. I know facebook uses it too, for its chat. It first calls this url: http://0.1.channel.facebook.com/x/a_bunch_of_parameters w...

How to prevent users from clicking multiple times on a linked image?

I have a page with a linked image, where the link takes a bit of time to load. Therefore, users tend to click multiple times on it. This occasionally causes errors to crop up in the code. How do I prevent users from clicking on the link more than once? In an attempt to remedy this, I changed the link to an onClick event and then in the ...

Google gadget boolean preference doesn't seem to work

I am simply trying to read a user's boolean preference in a Google Gadget, but it seems that the preference is never getting saved at all, and I only ever get whatever the default_value is. I've broken this down into a very simple test case. Here is my test gadget spec: <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs ...

Vista Gadget - Show tooltip on mouse over

Hello, I have a vista gadget that has a few DIV's and IMG's. The elements have 'title' attributes set to display a tooltip. If you are in the gadget, and it is focused the tool tips show... like normal. But if you click on the desktop then hover over something that is supposed to have a tooltip nothing shows up until you click the gadget...

How to get the form ID attribute in a delegate event...

$('form[role=form]').delegate( "input[role=submit_button]", "click", function() { alert( FORM.ID ); /// ???????????? }); IMPORTANT: without use closest() or parent() ... you know, when you write $('form[role=form]') here you have the element finded ... why to search it newly ??? ...

jquery and ajax tooltips don't work on live loaded content

Hello Everyone, I am using Ruby on Rails and Jquery as my library and 2 plugins but this should be a fairly plugin independent question. I am using the jquery.pageLess plugin which makes an ajax call to the pagination that is built in to rails in order to load new items onto the page when you scroll to the bottom (much like the new goo...

Is var necessary when declaring Javascript variables?

Possible Duplicate: Javascript: is using 'var' to declare variables optional? When creating variables in javascript is adding "var" before the variable name a must? For example instead of var message = "Hello World!" can I use message = "Hello World!" ? I notice that scripts like Google Adsense don't use var Example...

how use the right css for a device

i'm creating a site and i should use different css for different device (pc, ipad, iphone) it is possible to know which device people use to select the css??? ...

Grails: How to make a g:textfield autocomplete??

I have a g:textfield, and I want to write something and then show me all the options possible that start with the same letter. I understand that is called AutoComplete. Maybe using jQuery or JavaScript?? Any ideas?? Thanks in advance! ...

Eclipse: Setting up Run Configuration for HTML/Javascript Files

I want to use Eclipse as my editor for HTML/Javascript files. When I "Run", I would like to see a browser (any one of Internet Explorer, Firefox, etc on Windows) launched for my file. How can I set up a 'run configuration' to do this? ...

Make text selectable in a textarea within a jQuery Sortable parent

I have a table whose body I've made sortable using jQuery UI's Sortable function. Within this sortable table, I have a textarea which allows the user to enter comments about a given table entry. <table id="status"> <thead> <tr> <th>Name</th> <th>Comment</th> </tr> </thead> <tbody> <tr> <td class="dragHandle">Jason</td> <td><text...

Getting error -TypeError: service.UseService is not a function - when using webservices through javascript

Hello. I'm somewhat new to web development. I was following some web services tutorials and everything went good, from writing the web services to displaying their results after you clicked on a button on a html page. So I tried to run the service via javascript when the page loads, like this: <html> <head> <SCRIPT language="JavaSc...

IE problem with optgroup / option onclick event

This doesn't work with IE7. Does anybody know a work around? <select> <optgroup label="Swedish Cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> </optgroup> <optgroup label="German Cars"> <option value="mercedes" onclick="alert(1);">Mercedes</option> <option value="audi">Audi</option> ...

Use jQuery's switchClass method to fade in an element?

Is this possible? I've tried visibility:hidden/visibility:visible and display:none/display:block on the classes to switch between, but both result in the element popping in at the end. ...

Javacript redirects to source code instead of loading

I'm trying to generate an Amazon ad that should look like this. <script type="text/javascript"><!-- amazon_ad_tag = "xxxxxxx"; amazon_ad_width = "160"; amazon_ad_height = "600";//--></script> <script type="text/javascript" src="http://www.assoc-amazon.com/s/ads.js"&gt;&lt;/script&gt; Below are parts of my script that should achieve th...

keeping links internal to an iframe

I am working on developing for lack of a better term, a portal application that consists of a series of deployed WAR files all deployed on the same Weblogic server. Basically, I have one application that serves the navigation and a few other things. This contains an iframe that I load the other applications into. However, when a link i...

JavaScript Documentation Tool like JAutoDoc for Java

Is there a tool that would generate documentation for JavaScript functions similar to what JAutoDoc does for java ...