I have a couple of tables with similar structures like this:
<table>
<tbody>
<tr>content</tr>
<tr>content</tr>
<tr>content</tr>
<tr>content</tr>
<tr>content</tr>
<tr>content</tr>
<tr>content</tr>
<tr>content</tr> ..etc
--- The fake button is added here
<div class="addrow">Add another</div>
</tbody>
</table>
UPD...
I've got a fairly ajax heavy site and I'm trying to tune the performance.
I have a function that runs between 20 & 200 times, depending on the user.
I'm outputting the time the function takes to execute via console.time in firefox.
The function takes about 4-6ms to complete.
The strange thing is that on my larger test with 200 or ...
Hi folks,
I am using jQuery's scrollTo to make relative adjustments in the position of content inside a div.
Works fine: http://www.hmadvertising.com/test.php
However I also want to show and hide the control elements when they aren't relevant. Eg no Up button when scrollTop is zero and no down when scrollTop == scrollHeight.
The adj...
[1] Ok, I don't even know how to call this, to be honest. So let me get some semi-pseudo code, to show what I'm trying to do. I'm using jquery to get an already existing script declared inside the page, inside a createDocument() element, from an AJAX call.
GM_xmlhttprequest({
...
load:function(r){
var doc = document_from_string...
I want to be able to find out which DOM elements are present in the text currently selected by the user in the browser.
document.getSelection() would get us the currently selected text. But how can we determine which DOM elements are contained in this text selection?
...
I am making a simple accordion menu in javascript. I'd like to be able to set the compact and expanded heights for the elements via the css max-height and min-height values. For some reason, when I try to retrieve the min-height and max-height of the elements in javascript for animation purposes, I get an empty string rather than, for in...
My current project involves gathering text content from an element and all of its descendents, based on a provided selector.
For example, when supplied the selector #content and run against this HTML:
<div id="content">
<p>This is some text.</p>
<script type="text/javascript">
var test = true;
</script>
<p>This is some more...
I have the following lines of code:
$("a.quickview").fancybox({
ajax : {
type : "POST",
data : 'itemID=' + $(this).attr("name")
}
});
Which is binding on:
<a name="614" class="quickview" href="/URL/index.cfm">quick view</a>
I want data to post as itemID=614, but $(this).attr("na...
I have a web page that loads some stuff using AJAX. I want to display an overlay with a loading indicator while the loading is in progress, so that the user cannot interact with most of the page - except the menu at the top. I'm using jQuery and the jQuery BlockUI plugin to do this.
I call $(element).block() and it works fine, but the o...
Hello guys,
On a page I have, I need to move TinyMCE editors in the DOM tree once in a while. However, for some reason, the editor doesn't like it: it clears itself completely and becomes unusable. As far as I can see, this behavior is consistent between Safari 4 and Firefox 3.6, but not Internet Explorer 7/8. Here's an example.
It tru...
Hi,
I am a javascript noob.
I would like to select the second 'p' element of the div.box.
How do I do this?
Thanks a lot!
Tom
...
Is it possible to get the target element in a keypress event handler in a design mode iframe ? I know it can be done in the mousedown event handler (by accessing event.target), but in the keypress / keydown handlers event.target is always the iframe element. For example, with the following html, if the user types into the div where it sa...
Hi,
I have a form in a webpage where I would like to put the selected item in a drop down list into a testbox. The code I have till now is the following:
<form action = "">
<select name = "Cities">
<option value="----">--Select--</option>
<option value="roma">Roma</option>...
Hi, guys.
Here's a sample code, that opens an internet explorer window, navigates to google, and gets some element on the page by its unique id:
set ie = CreateObject("InternetExplorer.Application")
ie.navigate("www.google.com")
ie.visible = true
while ie.readystate <> 4
wscript.sleep 100
WEnd
set some_object = ie.document.gete...
I need to be able to store the current height and width of a div at any point in time.
Currently I am using div.style.height/width which works fine when the styling is applied inline.
The problem is that this returns for example 600px and not 600.
Is there a better way to do this? If not, whats the best way to get just the number 60...
Based on my previous question here and here, I found that I can set a cookie with javascript. I want to combine it with jquery to have a cookie state set for toggled table rows. I want to keep the hidden rows hidden upon reload.
Here is what I have achieved so far:
// Load cookies if any
if(readCookie('togState')) {
$('table#...
I have a question concerning a good strategy on how to fill a data "bean" with data inside an xml file.
The bean might look like this:
class Person
{
var $id;
var $forename = "";
var $surname = "";
var $bio = new Biography();
}
class Biography
{
var $url = "";
var $id;
}
the xml subtree containing the info might look lik...
For example, I want all the elements with an ID "hide_" + a value. This function must to return "hide_1" and "hide_30", etc, depending of the elements of the page.
...
I'm doing a fairly exhaustive series of DOM manipulations where a few elements (specifically form elements) have some events.
I am dynamically creating (actually cloning from a source element) several <select> boxes and assigning a change() event to them.
The change event executes, and within the context of the event, "this" is the HTM...
Alright, I'm at my wit's end on this issue.
First, backstory. I'm working on a video management system where we're allowing users, when adding new content, to upload and, optionally, transcode a media file. We're using Java applet for the browser-based FTP client.
What I want to do is allow a user to initiate an upload and then send th...