javascript

Partially transparent (opacity) HTML5 Canvas drawings

Is it possible to create partially transparent elements on the fly in canvas? Currently I'm setting the whole canvas element's opacity in CSS, but I want to some elements to be more visible then others. Nothing I've found so far indicates that this is possible. ...

How to open and save text in html to a file using javascript in HTML

i have a textarea and two buttons like <form name="form1"> <textarea name="text1"> HTML Codes goes here </textarea> <input type="button"> Open File <input type="button"> Save File </form> when i click on "save" button i want the text in textarea to be saved (i want it to pop up the "save as" dialog box) When i click on "open" , it...

Are there any JavaScript 'packs' that can make CSS3 compatible on IE browsers?

I was wondering if there are any packages available out there to make CSS3 capabilities available to browsers that do not support it yet. The way I envision this, and I've been unable to find anything via search, is the JS would detect the browser and load its own library that essentially do the CSS3 functions using JavaScript. I kno...

how to wait with setTimeout until a variable get loaded and, at the same time, receive HTTP requests!

I' ve made a in JavaScript function to check every 100 ms if a global variable is loaded. When the variable will be loaded the function will return the value of the variable as shown below. In my code I use an HTTP server in JavaScript, and the variable will be loaded when a specific HTTP request with specific headers arrive to my server...

Twitter Widget - Only Post Tweets Less Than Two Days Old

Hello. I have this Twitter widget that works really well (and is easily customizable), but I have one issue with it. I only want to post tweets less than two days old, but I can't figure out how to do it. So in the HTML, I have the following: <ul id="twitter_update_list"></ul> <script src="/assets/script_twitterwidget.js" type="text/j...

Format Number based on Format String in JavaScript/jQuery

Let's say I have a format string "XXX - XXX - XXXX" (to format a phone number), or any other format string in which X stands for a number I want to preserve the formatting in the format string (spacing, dashes etc.), but exchange each X for a number and drop all formatting in the source string Examples: Input: "abc+d(123)4567890",...

YUI shrink panel around content?

Hi, I have a YUI resizable dialog that contains a multi-tab widget. Works fine on IE > 7, Safari, FF, Chrome. Question: Initially, when a user changes tabs, the dialog shrinks to fit the new tab. But after the user resizes the dialog, if a new tab is selected, the dialog does NOT shrink to fit the new tab. How can I change the size o...

Whats difference between library EXT-JS , EXT-CORE , EXT-GWT

Whats difference between library EXT-JS , EXT-CORE , EXT-GWT as i have worked on ext-js so please explain me in a layman language :) ...

Animate returned elements from each() in order

I'm using this script to animate some images inside anchors: $('#locations a').each(function() { // set opacity 0 take initial position $(this).css('opacity', '0'); var left = $(this).css('left'); var top = $(this).css('top'); // reset position and animate $(this).css({'left' : '0', 'top'...

jQuery Creating a style element on fly

Hello, I'm want to create a style element after loading of page ( say about 2-3 sec after page loaded ) html <html> <body> <div id="div1" > <div id= "div2" > some text goes here </div> </div> </body> </html> javascript $(function() { var style = $('<style type="text/css" />').appendTo('head'); ...

Keeping the native style of a context menu in webpages

Hi folks, I know everyone hates when their context menus get messed with so what I'm asking for is the opposite of that. I've tried looking for javascript plugins that deal with changing the context menus in webpages, but I find that they are very intrusive. (i.e. the context menu now only contains the items that the developer chooses)....

jQuery preventDefault action works, but the rest of my script doesn't appear to be working.

I have three tabs, made up of images that change when you rollover them. The rollover effect is achieved with the following example css. a#tabButton_profile { height: 30px; width: 133px; display:block; background-image: url(img/content_tab_profile.jpg); } a#tabButton_profile:hover{background-image: url(img/content_tab_p...

Server side javascript on Google app engine

Is there any way to run a Javascript engine, like Spidermonkey, on Google App Engine? Spidermonkey is a C module, so obviously that wont work (GAE doesn't allow those types of modules)... is there something else available? ...

Open links in a new window

I have a div called 'divLinks' I want all links inside the divLinks to open in a new window. How can I write a cross-browser effective script to achieve this? ...

how to build custom focusable object in HTML/JavaScript

I want to build a custom object in HTML which is focusable. How can I do that in general? More specific about why I want that: I need some kind of editor component with much more power and control over it. I.e. no single character should be possible to be typed in directly. It is like a big tree of objects (imagine an AST or so) and you...

JSONP vs IFrame?

Soon I'll be needing to build a widget that some of our clients can embed in their own websites. To future proof my widget the embed code would be something like this: <script type="text/javascript" src="path/to/remote/file.js"></script> <div id="my_widget"></div> What are the strengths and weaknesses of iframes vs JSONP? Are there ...

Data visualization: Bubble charts, Venn diagrams, and tag clouds (oh my!)

Suppose I have a large list of objects (thousands or tens of thousands), each of which is tagged with a handful of tags. There are dozens or hundreds of possible tags and their usage follows a typical power law: some tags are used extremely often but most are rare. All but the most frequent couple dozen tags could typically be ignored, i...

How do I add an onChange event to select tag in CakePHP?

I am trying to use AJAX to populate some select boxes that were autogenerated using CakePHP's formHelper. How do I add the onChange event listener to the select box? ...

Remove event listener added with eval

I'll try and explain the best I can... I have a page, we'll call it pageA. When a button is clicked on that page, an ajax request is sent out and the return data is eval()'d. That data obviously contains javascript code. This code could possibly contain event listeners that are added to pageA when it is eval'd. Something like jquery...

How to make a "Print" button disappear.

I followed one example: I have a print image button. When clicked, the button opens the print dialog and then I want to hide the image button. But, initially I am not able to see the print button to click on it. <link href="style-print.css" rel="stylesheet" media="print" type="text/css"> #print { display: none; } <div style="flo...