jquery

ajax security ?

When I look back my codes that written earlier time, I found something terribly bad. Whenever I want to delete a record in the database, I did like this : $.post("deleteAction.do",{recordId:10}); I cannot prevent a malicious user visit my database operation url directly : deleteAction.do?recordId=10 What's the solution for this ki...

Does anyone have a easy-to-use .png fix for IE?

I'm looking for an easy way to make IE accept .png images without the ugly white area where transparency areas are supposed to be. So far I've tried several png fix packs that seem to have too many configuration settings that I can't get to work...any GOOD suggestions? ...

jquery, attaching objects (instead of string attribute) to an element

Hi! I'm trying to build DOM with jQuery and fill it with data that is received with AJAX (data type = json). I'd like to also store this data as an object, attached to a specific DOM element. Does jQuery provide any method for this? The reason I want to do it is because only part of data is initially displayed; other data might be neede...

order of onclick events

I want to add a jquery click event to href's that already have an onclick event. In the example below the hard coded onclick event will get triggered first. How can I reverse that? <a class="whatever clickyGoal1" href="#" onclick="alert('trial game');">play trial</a> <br /> <a class="whatever clickyGoal2" href="#" onclick="alert('real g...

How can I make my javascript chat polling script be more efficient?

For some reason this check for new chat messages causes a larger amount of browser (and to some extent server) load than I would expect. Anyone see any ways that I can make it more efficient, to lessen the load? // Begin the cycle of refreshing the mini chat after the standard delay. function startRefreshingMinichat(){ var secs = 3...

How to focus on a specific div using window.location = [x] in jquery.

I've got a window.location function that redirects to a site that is not programmed by me. When the window is relocated I need it to focus on a specific div tag (with an id) within that page. Is there a way for me to do that if the page is not mine and I do not have access to the code? UPDATE so I've got this now and it's working... ...

JavaScript two-dimensional Array to PHP

Hi I have to send a two-dimensional JavaScript Array to a PHP page. Indeed, I'm working on a form-builder, in which the user can add or remove fields. These fields are added (or removed) using JavaScript (jQuery). When the user is done and hit a 'publish' button, I have to get all the fields concerned and send them to a PHP page which w...

jquery document height reported incorrectly by IE (on XP) first time

I'm having a "first time" problem with IE, which reports a different value for $(document).height(); when the page first loads versus subsequent queries. The difference is 17 pixels regardless of the opening size of the window -- on document ready, the height reported is 17 pixels larger than is subsequently reported. I wonder if this is...

Setting the value of textboxes with one of their attributes (jQuery)

I have a bunch of input text boxes that have the attribute ORIGINAL set to their initial value, so that when the user changes the textbox value, jQuery can highlight items that have changed (by comparing the text box's current value to the ORIGINAL attribute's value) What Im trying to do now is provide the user with a button that they c...

Jquery to hightlight elements in a list

Hi I have a ol list: <ol> <li class="group1">item 1</li> <li class="group1">item 2</li> <li class="group2"> item 3</li> <li class="group3">item 4</li> <li class="group1">item 5</li> <li class="group3"> item 6</li> <ol> and a set of checkboxes which correspond to the class names <input type="checkbox" value="group1" />group 1 <input ...

jquery not working in internet explorer using mvc

i have a group of radio buttons that are generated on the fly from the db into a partial control then rendered on the page as html and they all have the same name now in firefox and chrome the following code works fine $(".FlightSelectedRadio").live('click', function() { alert("after flight select"); $("#ToisGarantueedBid").at...

On Click alert if $.get returns a value, if not, submit the form

If the submit button is clicked, prevent the default action and see if the field 'account_name' is already in use. If the $.get() returns a result, alert the user of the results. If it doesn't, submit form with id="add_account_form". My problem is that my else{} statement is not submitting the form. I get no response when submit is cli...

Problem with errorPlacement in validator plugin jQuery

Hello, I am using the validator plugin of jQuery. By default the error label is added below my form. I want to add it above my form. So what I am doing is adding the code below in the validate(): errorPlacement: function (error, element) { error.insertBefore('form#emailForm'); } The problem is that the error label now is added a...

jquery ui draggable custom helper element

Im working on building a jquery plugin to re-arrange the order of columns in a table NOT table rows! I'm using the jquery ui draggable/droppable libraries to do this. The table header cells are the draggable elements. Once a header cell is dragged I want the helper element to be a cloned verson of the table column. So far I've come up ...

How to increase/decrease current margin at a number by jquery?

Given an element with unknown margin-left, how to increase its margin-left at a number say 100px? For example: assuming the original margin-left is 100px the expected result is 100px + 100px thus 200px finally. ...

Click event not registering on second page.

I'm using tablesorter and tablesorter.pager. Here is my code. $(document).ready(function() { $("#peopletable") .tablesorter({ widthFixed: true, widgets: ['zebra'] }) .tablesorterFilter({ filterContainer: $("#people-filter-box"), filterClearContainer: $("#people-filter-clear-button"), filterColumn...

Select every other 2 table rows with jquery

I am currently using this code to add a class to every other row in my table. $(".stripeMe tr:even").addClass("alt"); However, on another table I'd like to add a class to rows 3,4, 7,8, 11,12 and so on... Is this possible? ...

jQuery onclick selector doesn't work

Hi, I have a selector: $("input[type='button'][onclick^='save']") and it works in FF but on IE... There is something wrong with onclick selector part. Is there a way to make cross-browser workaround? Thanks Pawel edit: $("img[src$='scroll.gif']").click(function(){ var targetOffset = $("input[type='button'][onclick^='save']...

Selecting first instance of class but not nested instances via jQuery

Given the following hypothetical markup: <ul class="monkey"> <li> <p class="horse"></p> <p class="cow"></p> </li> </ul> <dl class="monkey"> <dt class="horse"></dt> <dd class="cow"> <dl> <dt></dt> <dd></dd> </dl> <dl class="monkey"> <dt class="ho...

jQuery caches AJAX request in IE even though cache: "false" is set.

I have the following code $.ajax({type: "GET", url: "/" + filename, dataType: "xml", cache: "false", success: function(xml) { /* Parsing code here */ }}); In Chrome etc the requests are not cached, however they are in IE. Am I constructing my request properly? ...