jquery

jQuery html() not adding html to div

Why? I have $('#someselector').html('<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;...'); <div id="someselector"></div> I keep getting this nasty error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsIDOMDocument...

Error with jQuery dataTable plugin 1.6.0

I am using dataTable.1.6.0, below is the my code... $('#eventsPane div.genreEvents table').dataTable({ scrollHeight: 410, "aoColumns":[ {"bSortable":false}, null, {"bSortable":false}, {"sType":"date","iDataSort":4}, {"bSortable":false}, null ], "aaSorting":[[3,'asc']] }); ...

How Do i use JQuery to update the data

Ok so i am having a problem with figuring this problem out. I have a dynamic page that has records pulled out of a mysql database. The php code works great. The code is below $catagory = $_GET['type']; $query = "SELECT p.name, p.price, pc.quantity, p.image, p.descr FROM products ... where category_name = $catagory "; $result = mysql_qu...

How to select elements within a variable using jQuery?

Hey, I'm trying to make a simple image browser for TinyMCE which I am using in my CMS. As part of this I need to detect whether the user has selected an existing image, so I can display the "edit" form instead of the "choose an image form". var selected_html = ed.selection.getContent(); var $elem = $(selected_html); console.log($elem); ...

jqGrid and JSON reader

I'm fairly new to jQuery and just started working with jqGrid. I've looked over the jqGrid docs in order to figure out how to display some data I'm receiving back in JSON format within my grid to no avail. When I create the grid, it displays with the correct headers, pager info, etc and via Firebug and I can see the request and respons...

IE8 jquery weirdness with .click() and .ajax() function.

Strange problem here... UPDATE After adding a lot more server side debugging, I found that handleLookupButton($("#select-circuit").val()); and handleLookupButton($(this).text()); both do call the ajax function with the same values. The problem is that handleLookupButton($("#select-circuit").val()); does not wait around for the serve...

how to declare variable in javascript

$("#btnsub").click(function () { var add = $("#txtname").val(); var obj; var geo = new google.maps.Geocoder; geo.geocode({ 'address': add }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { obj = results[0].geometry.location; obj = convert(obj); alert...

How to achieve a "Max Length" type effect using JQuery?

In an html input box the max length attribute prevents the user from typing more than a certain number of characters. How can I achieve something like this using only jquery. And unlike the max length attribute this should also work in a textarea. ...

How do I find closest element with jQuery

I have the following HTML code: <td> <input type="text" size="40" value="" name="related_image" id="related_image"> <input type="button" class="button addImage" value="Get image url"> </td> <td> <input type="text" size="40" value="" name="alternative_image" id="alternative_image"> <input type="button" class="button addImage"...

How to prevent user from entering text into a form field using JQuery?

I want to prevent the user from entering more than 100 characters into a textarea. I already wrote the code that will detect when the user's post reaches 100 characters. But I have no idea how to prevent him from typing any more beyond that point: $(document).ready(function(){ $('.comment').keyup(function(){ var count = this....

how to split/take away unwanted characters

I have for example: (111) 222-3333 - Verizon ... I want to when I select this fill in two text box. The first textbox having (111) 222-333 and in the second textbox with Verizon. Is this possbile with jquery? ...

Where is the JSON Results from my jQuery AJAX POST Call?

I have this code setup in a web page. <div id="gridResults"> </div> <script type="text/ecmascript"> jQuery.ajax({ url: "http://localhost:6002/AggregateServices.svc/incident/10", type: "POST", async: true, success: function(json) { var table = jQuery('<table />'...

how to prevent using space while typing?

hello all.i have one textfield for input some serial number code.i want set this code show alert if someone use spase. it means space is not allowed and just allowed use minus for separate this code. Are you have any idea for resolve this problem? can i use jquery validate? the correct typing: 135x0001-135x0100 ...

How do i know on which row was clicked in jquery

I have table which contains the rows that are dynamic from server side scripting(PHP) and also using Zend Framework . So each row will have hyperlink with id SOmevalue(Dynamic) now each row will have contextmenu (Jquery Plugin ) appended to each row by the below code. $("#myTable td:first-child").contextMenu("myMenu1",{ ...

Jquery Jpoll Plugin not working

Hi, I am refering http://www.danwellman.co.uk/category/plugin/ for Jpoll stub But getting Java script error as "Expected :" Following are my code details <TABLE CELLPADDING="1" CELLSPACING="1" BORDER="0" WIDTH="98%" height="100%" CLASS="GridOne"> <TR><TD class="boldText">Todays Poll</TD></TR> <TR><TD><div id="pollContainer"></div><...

jQuery check/uncheck problems

I'm using a gridview that has a radio button in one of the columns. It's used as a true/false flag. Anyways, because of the nature of my project, I require javascript to uncheck any radio buttons when I check another one. This works fine, except that my gridview is wrapped in an update panel. I am taking care of reintializing the jQuery ...

garbage collection of jquery.html

i was wondering if the following code would cause some problems like memory leak <html> <head> <script type='text/javascript' src='jquery-1.4.2.js'> </script> <script type="text/javascript"> function a(){ for(var i = 0; i < 50000; i++){ $("#d").html("<span>" + i + "</span>"); } ...

Find an element in a div using the attribute ends selector

I am trying to find hidden element in a div using the attribute ends with selector and I am running into issues. I have a jQuery object which represents div and I know that my hidden input is in this div and it ends with "-id", but I am not able to locate it. This is my code var clickedContainer = $(theThis).parent().parent().paren...

CakePHP: Controller Response for Ajax Request is wrong

Hi, I'm using jQuery to make an AJAX request to some controller action. This request is activated from a button in the view of the edit action in the same controller. My problem: The Ajax Request is returning all the code of the edit view (with all the forms and inputs) instead of the expected number. If I put the same ajax button in ...

how can i apply jquery elastic on multiple textareas

i am generating multiple textareas with php with id i.e <textarea id="here php generated id" class="txta"> now i want to apply jquery elastic to each of these textareas... ...