javascript

Creating tables dynamically in jQuery

Hey everyone, I'm building some data dynamically using jQuery, but I'm getting the following error: Uncaught Error: HIERARCHY_REQUEST_ERR: DOM Exception 3 This happens at the appendTo part of a script that looks like this: $('<tr />').append( /* lots of stuff */ ).add( $('<tr />') ).append( /* some more */ ).appendTo($tbody...

Disable Copy/Paste into HTML form using Javascript

Is there a way using Javascript to disable the ability to paste text into a text field on an HTML form? E.g. I have a simple registration form where the user is required to input their email twice. The second email entry is to verify there are no typos in the first email entry. However if the user copy/pastes their email then that def...

How to get browser to navigate to URL in Javascript?

What is the best (correct, modern, cross-browser, safe) way to get a web browser to navigate to a URL of your choice using Javascript? ...

Creating new definition for my CSS with JavaScript (and mootools if needed). Selectors problem.

I'm making some divs clickable with JavaScript. I'd like to use CSS to make the user understand that they are clickable, for example changing the color of links inside a div when mouse enters the div. In CSS it is: #menu > div:hover > a { color: #f00; } and it works like a charm. I'd like the color of the link to change when you...

How to create animated text using ExtJs

Can any one please help to how to create animated text using ExtJs ...

How can I get the TRUE height of a div?

I'm trying to determine the height of a div. This sounds simple, but is complicated by the fact that it's only descendant contents are floated, so asking for the height/outerHeight (using jQuery)/clientHeight/offsetHeight only returns 0, even though it's clear that on the page, it is rendered certainly with a height. Here is an example o...

node Attributes[] array giving additional attributes in IE

Hi, I am using "node.attributes" to retrieve all the attributes of a DOM node using JavaScript in IE. It gives me additional attributes which are not specified in the source .In Firefox it gives only those which are specified in html source (which is expected). is there any way to retrieve "only the attributes" of a DOM elements which...

editable datagrid with ability to clone individual rows

Im looking for a way to render an html table as an editable datgrid, with the ability to clone individual rows. I dont need to save any of the changes made, just superficially edit the cells because i then use a jquery plugin to scrape the table as is on screen and save it. Ive tried jeditable, but its designed for posting the output of...

making un-visible a specific part of url generated by javascript + codeigniter

Hi friends, http://www.blabla.com/our_work/client/client-name#/uploads/18.jpg I use CodeIgniter, and this is the url I have. I use a gallery script at the page, and it generates #/uploads/18.jpg such thing at url :( is there any way to make it unvisible or sth . maybe with htaccess. i dont know. i dont want to spend an another day ...

can I update a label using ajax, instead of a textbox?

Hi, I'm using ajax to update a textbox once the value in a drop down box has been selected. However, i only update/put text in it if certain conditions are met, so it looks rubbish when there is no message. I was thinking that having a label there would be much better, but is this possible? Can i have an empty label and just update the ...

Query string parameters do not seem to work with window.open

Hello everyone, I try to open multiple browser windows using javascript and the window.open() function. I want to pass a parameter through the query string to my new window like this: window.open('http://www.myfoo.com/foopage.aspx?fooparm=1', '_blank'); This opens a new window with the correct address in the address bar but the brow...

Disable keyboard in HTML SELECT tag

I want to disable the keyboard for an HTML SELECT tag so the user can only use a mouse to select the options. I've tried event.cancelBubble=true on the onkeydown, onkeyup and onkeypress events with no luck. Any ideas? ...

Indexing an array every cycle (in seconds)

I have to put datas every 10 seconds in an array. Is it silly to index this array with modified timestamps $a[timestamp] = 54; $a[timestamp+10] = 34; or in Javascript with the setInterval() and passing via Ajax the index (very crappy to me) ? or have I a best option ? Further details : I have to link the real-time with entries in...

Get Class List for Element with JQuery

Is there a way in JQuery to loop through or assign to an array all of the classes that are assigned to an element? ex. <div class="Lorem ipsum dolor_spec sit amet">Hello World!</div> I will be looking for a "special" class as in "dolor_spec" above. I know that I could use hasClass() but the actual class name may not necessarily be k...

What cross-browser charting packages are available?

Hi, I want to include some charts on my website and I'm looking for a good cross-browser charting package - what are my options? ...

gmail type filechooser for firefox

I have a simple requirement: One browse button opens multiple file choosers. When file is chosen, its filename gets added to an order list. This works just fine in IE, because i can programatically click on hidden file inputs, but firefox does not let the click event open the file choose dialog. Question: What options do i have? ...

Javascript function locating right element

This is partial markup: <tr class="Comment"> <td class="CommentCheck"> <input id="ctl00_col2_rptComments_ctl01_chkBox" type="checkbox" name="ctl00$col2$rptComments$ctl01$chkBox" /> <input type="hidden" name="ctl00$col2$rptComments$ctl01$hdnFldItemID" id="ctl00_col2_rptComments_ctl01_hdnFldItemID" value="35" ...

Javascript multiplication w/value stored in another cell.

Update: Final Fix: $('.gasamount').sum(); var num = $(this).attr("id").replace(/[A-Za-z$,-]/g, ""); $('#gasmoney'+num).val(<cfoutput>#mileage#</cfoutput> * $(this).val()); $('.gasmoney').sum(); What I've been trying to accomplish: Create a set value for a row of cells. Multiply the user's value by a stored amount. Get th...

using aptana.log without switching to debug prespective ???

i want to use aptana.log to write messages in aptana console view without having to switch to debug view which launch external browser (firefox) , i already have console.log in firefox, i want to log messages in aptana console without launching external browser ????? ...

RJS not updating html table elements

I have a link_to_remote function that updates columns in a table. However, it does not properly update the cell or its properties. For example: Here is the element I am updating: <div id= "calendar_div_<%= i%>_<%=j%>" style = "display :inline;"><td class="checkedout">X</td></div> Using this call: <%= link_to_remote 'Current Wee...