javascript

Can I debugger.break() on all changes to a DOM element?

I would really love to be able to see the code that is affecting a specific DOM element. But I also would really love not to have to look through all my javascript searching for references/selectors that might be causing the issue. Does anyone have a technique for causing a browser debugger to break on any changes to a specific DOM ele...

How not to lose focus on a login page

I have a simple login form with 2 input fields: "username" and "password". "username" field is focused by default. The problem is that when user clicks outside "username" or "password" fields, the focus is gone (it is neither on "username" nor on "password" fields"). How can I force the focus to be on these 2 fields only ? In my case, ...

jqGrid: how to change cell padding

Hi, I'm using jqGrid3.6.5 on google hosted jQueryUI1.8.2 and jQuery1.4.2 I want to change the cell padding of a jqGrid. For testing purposes I want to set it to 10px all around each cell. The only option I've come across while googling is the following: add padding with CSS. eg. #grid-id td, #grid-id th { padding:10px; } set cellLay...

Minifying Javascript on Visual Studio 2010 on release mode

I have a ASP.NET MVC 2 project on Visual Studio 2010. I want to be able to use my plain javascript files in debug mode so I can understand what's going on when debugging, but I want to used a minified/compressed version when using release mode. I was planning to create some extenders to include the js files in each page, something like:...

(jQuery) javascript setTimeout clearTimeout

Hi I try to make a page to go to the startpage after eg. 10sec of inactivity (user not clicking anywhere). I use jQuery for the rest but the set/clear in my test function are pure javascript. In my frustation I ended up with something like this function that I hoped I could call on any click on the page. The timer starts fine, but is n...

table height not 100% in IE7 but it works in FF3.6

In this page, the height of the payment method area is shorter than the height of the parent element in IE7. How can I fix this Do I have to apply shading to the parent element - a table cell - instead of the table? This is the page: https://checkout.netsuite.com/s.nl?c=659197&sc=4&whence= This is the login info: email: test...

Drap-n-drop HTML table columns (not rows)

Good day! I've found dragtable http://www.danvk.org/wp/dragtable/ but I need a Jquery-based solution. May be I'm missing something? Thanks in advance! ...

When click on title, make information appear on another div for the information?

I'm looking for a jQuery solution for this. When I click, let's say on a artist name. Theirs another div beside that has the information showing up. (possibly in a animation/fading way) Can anyone help? ...

How do I get Colorbox to display 5 seconds after the page loads?

Here is what I have so far, but it is loading right away: <script type="text/javascript"> var pid = <?php echo $_GET['id']; ?>; var rlink = "<?php echo $domain; ?>share.php?pid=" + pid; $(document).ready(function(){ setTimeout($(".url_tag_small").colorbox({ href: rlink, width: "620px", height: "354px", opacity: 0.0, transition: "non...

Forwarding Mouse Events through layers/divs

Hi Does anybody know of either a Jquery or native JS way to enable mouse events through layers? e.g. enable a link underneath a div. Other solutions but cannot use in my case: The simple way, although using not really supported 'pointer-events' http://hacks.mozilla.org/2009/12/pointer-events-for-html-in-firefox-3-6/ A ExtJS solution: ...

How does this javascript closure work?

Here's some javascript: linkElem.click(function () { var data = linkElem.data(); alert(''+data.mls + ' ' + data.id); }); It works. linkElem is a local variable that I create in a loop inside a function. I assign some data to it with jQuery's .data(). If I did not call .click(), linkElem would be reass...

remove or disable focus border of browser via javascript

Hey guys, does anybody know how to disable or manipulate the (in most browsers) dashed border of a dom-element if it has the focus in a tabindex order? i want to build my own style for a focused element but it would be great to use the exixsting feature -because with tabindex it is possible to bind keydown event to the dom-element ... ...

need to extract certain values from attribute and place them in variables

In the following markup on a page I want to extract out the following and put them in seperate variables. 1- In the onclick attribute get the value after the "ProductID" and put it in its own variable. "ProductID" So in this case it would be 318 2- In the onclick attribute get the value after the "Orig_price" and put it in a variable,...

How do i get the full path of the file in Firefox

How do i get the full path of the file in Firefox with JavaScript? Thanks in advance! ...

Remote Ajax Call in jQuery .click() function doesn't finish before going to next page.

I need to send click information on my website to a third party server using ajax (json). I am using jquery and I added the click event to certain links. In the click event I am making a json request to a remote server with the location of the click (heat map) and some other information. The problem is that the ajax function doesn't fir...

Fading out an error box from codebehind

I have an error message box that gets displayed somewhat frequently (due to the nature of my program). Some sample code: <asp:Panel runat="server" ID="ErrorMessagePanel" ClientIDMode="Static" CssClass="messageError" Style="visibility: hidden;"> <img src="../Images/RedClose.png" alt="close" class="messageCloseIcon" onclick="HideMessa...

jQuery.closest(); traversing down the DOM not up

Afternoon peoples. I am having a bit of a nightmare traversing a DOM tree properly. I have the following markup http://pastie.org/999519 ... And I am trying to traverse from input.save at the bottom right the way up to div.node... This all works well with one copy of the markup but if I duplicate it (obvisouly changing the ID of the ...

Applying attribute to SVG using JS prompts 'this.textBox.style is undefined'. Why?

Hi, I'm using the following code to draw an SVG text box, and then change its text anchor attribute to 'left' as it defaults to center and that's nasty. The text generates correctly, but when I add this second line I get the error 'this.textBox.style is undefined' in my error console. Here's my code: RenderTextBox:function() { ...

Need help with jQuery/AJAX call in Safari/Mac

I've got something that works perfectly in FF and MSIE but it's not working properly in Safari. It's a form with selects that get updated via AJAX/jQuery from a MySQL DB. In Safari, when you select the first item, it correctly loads the options for the next select menu; however, when you choose one of those (which loads new options in a...

parse Java JSONArray with jquery.parseJSON()

Hi Guys, at the moment I'm parsing the string with eval()-method and it works fine, but want to parse it with the native JSON methods of a browser. Is there good way to parse the string with jquery.parseJSON() or with any other jQuery method to an array of javascript objects? The string looks like [ { "title": "01 Books",...