javascript

How do i make a fluid float:left layout?

For example, i'd like to have a grid of boxes all floating left. I have the design here: atbskate.com/trusktr. The boxes on my site are all float:left. However, when i expand a box by adding content into it (ajax) it shifts the other boxes and leaves an ugly empty space. I'd like for the boxes to fill up this empty space. The idea woul...

seedjs vs npm as package manager for javascript?

It seems to be two package managers for javascript at the moment. Seedjs and Npm. Which one should one use? ...

Button in popup that get selected text - Chrome extension

Hello, In my popup.html in my chrome extension I have a button that will get the selected text in de webpage and put it in my textarea in the popup.html. First I select text in a webpage I click on my extension. An popup will show with a textarea and a button. When I Push the button the selected text will show in my textarea. is so...

Help with regular expression in javascript

Hi, I need a regular expression that would split strings like itemXY where X and Y are integer (item23) to be used in javascript. I would like it to return the integers x and y. Thanks ...

How to get the coordinates of the end of selected text with javascript?

Hi, My problem is similar to this, but I need a way to get the coordinates of the right side of the selection with Javascript in Firefox. I made a small example to show what I mean: The code I got from the other post is the following: var range = window.getSelection().getRangeAt(0); var dummy = document.createElement("span"); range....

How to refactor conditional logic in javascript?

I inherited a largish JavaScript (MooTools) application for browsing and configuring products. In it there's a function that tracks the products' configured state. Other functions are called depending on what state the product is in. I extended it to add some new features, but have ended up with a mess of nested conditionals inside a b...

get dynamic properties in javascript

var tinymce_toolbar = {} tinymce_toolbar.__default = { script_url: '/cms/libs/js/manual/renders/tiny_mce/tiny_mce.js', }; tinymce_toolbar.__simple = { script_url: '/cms/libs/js/manual/renders/tiny_mce/tiny_mce_simple.js', }; // Doesn't work var t = $(this).find('input[name=toolbar]').first().val(); $('.RenderHtmlEditor').tin...

Is there really no way to hook into the reset event of an Ext.js component?

When I reset a form in Ext.js it resets every child component, but the only events fired are invalid and valid. It seems a bit "hacky" to hook them to handle the clearing of a value, is there no other way? The "problem domain" is that I am writing a plugin to create dependent comboboxes: Ext.plugins.combobox.DependsOn = function(depends...

Problem with getXMLHTTP()

I have the following code: <script type="text/javascript" language="javascript"> <!-- function getXMLHTTP() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new Acti...

how can i call method of class outiside the class javascript

var Card = YClass.extend({ // define Class Name className:'Card', // class level default options config:{ id:'cardid', container:'body', // id of container in which to render the user render:false, template: 'tmpl_card', // id of template used to render user debug:false }, setposition:function() { var i=1; var ...

js override console.log if not defined

Witch solution do you recomend, the second is simpler ( less code ), but there are drawbacks on using it ? first: (set a global debug flag) // the first line of code var debug = true; try { console.log }catch(e) { if(e){ debug=false; } }; // then latter in the code if(debug) { console.log(something); } second: ...

how to disable whole body other than a div

Hi friends,I have a div which is creating through ajax, i would like to disable the whole body once the div is popup and until, unless the div is closed.Is this possible in jquery. Please let me know your suggestion Thanks,Praveen Jayapal ...

position of div in particular div

i have one card window div in which <div id="cards_window" class="popup_window ui-dialog ui-corner-all" title="Cards"> <div id="cards_title"> Cards <div id="cards_window_close" class="ui-button ui-icon ui-icon-circle-close popup_close"></div> </div> <div id="cards"> ...

How can I import my Java packages into a js file

Hi JavaScript experts, I was wondering how to import my java packages into a js file and then call class methods on created object. The reason I need to import is I wish to get data from a connection to my database, regarding dates and I have a class that lets me do so. So I need to import the Package, then create a class object, th...

javascript find anonymous reference

I have this inside the HTML that is creating an object in JavaScript var myObject = new MyClass(); I know that after this I can refer to myObject and use it. The problem is that I have the instantiation done in an anonymous way e.g. new MyClass() Is there a way to find then the instance so I can reuse it later in the code ? Any id...

IE, textarea value is not changed when pressing buttons

I have an realy nasty problem with focus in internet explorer. I have a textarea for inputing text. This textarea is not visible for the user and is only used to provide robust text input for a more advanced view. As the textarea isn't visible and shouldn't be i use textarea.focus() in the javascript to activate text-input. This has wo...

animating path's width

i have a path like this var r = Raphael('graph', 600,400); var l = r.path('M 300,185 L 75,185 Q 65,200 75,215 L 300, 215 Z'); i want the path to animate to final position var l1 = r.path('M 350,185 L 75,185 Q 65,200 75,215 L 350, 215 Z'); Its a rectangle but curved from left side. I want to animate its right side to left/r...

Html table does not redraw after adding to its DOM ie8

IE bugs out on me with a large table by not redrawing the table when I add input's to it using jquery. It forces a redraw/update when I scroll the table up or down but otherwise it doesnt render the input properly. <div style="overflow: auto;"> <table> <tbody> /// lots of rows </tbody> </table> </div> an...

Show/hide nested rich:subTable in rich:datatable

I've nested a subTable inside a dataTable as follows: <rich:dataTable value="#{myBean.dataList}" var="dataItem" > <f:facet name="header"> <rich:columnGroup"> ...

Passing rendered html to a javascript function

Hi all, I have some html code rendered on the server side. This is passed to a jsp which renders a javascript-call with this html: <script type="text/javascript"> window.parent.${param.popup_return}("${helpId}", "${content}"); </script> content is like " This is a <p class="xyz">test</p> " My problem is that - according to the...