jquery

How do I get my textarea to preserve newlines when using jQuery and JSON?

I have an textarea for user to input comment and a button to submit using jQuery .post() and JSON. $('#submit').click(function () { var comment = {}; comment.Author = $("#author").val(); comment.Email = $("#email").val(); comment.WebSite = $("#url").val(); comment.Body = $("#comment").val(); // te...

Form value addition with js

Hi. I'm trying to write a order form that shows the value of the selected items automatically. The backend is already complete, and on the front end each field, all radio / checkbox, look like this: <input type="radio" name="shirt-size" value="shirt_size_m[18]" /> '18' being the price, everything else being irrelevant to the front en...

Does live Change still not work in IE 8 with jquery 1.4.2?

Hi I heard this issue is fixed in jquery 1.4.2 but I am still getting this problem. I am using "~/Plugins/jquery-1.4.2.js" I have this $('#id').live('change', function (e) { // do stuff }); It works in firefox 3.6 but not ie 8. ...

Avoiding conflicts in jQuery and jQuery extensions !

I'm using jQuery and some very-common-jquery-plugins in CMS extensions (including jQueryUI and jQueryTools along with many others) in some CMS extensions that are used by many people in a wide array of situations. I always get into issues where there are conflicts between my extension's plugins and plugins added by another extension on t...

why jquery can't return string/text ?

default.aspx <button id="getGrouper">GetGroupers</button> <script type="text/javascript"> $(document).ready(function () { $("#getGrouper").click(function () { $.ajax({ type: "post", url: "Groupers.aspx/groupers", data: "{pid:25}", ...

JqGrid not loading data from JSON

I have a JQGrid plugin in my website, the table is loading OK, but with no-rows to edit, select or whatever. It is requesting the server because when i watch the log I see the request and it's parameters (sidx, _search, rows, sord, nd, etc). This is the jqgrid code: $(document).ready(function() { var lastsel; jQuery("#rowed3")....

jQuery Coding Conventions

I've been looking for some jQuery coding conventions, but really found a comprehensive list. For example, how should I name the id of my html tags, I like the first one because it confoms to my css convention, but would it give me inconvenience in some senarios? <div id="comment-list"></div> <div id="commentList"></div> <div id="Commen...

jQuery Regular Expressions - Strip ID from URL

I am being fed a url that looks like this: http://hamilton.kijiji.ca/c-buy-and-sell-sports-bikes-Kids-bike-W0QQAdIdZ215282410 I want to pull out the numbers after adIdZ How can I pull these numbers off dynamically? ...

jquery auto-grow text area versus initial text

There's a very simple jquery plugin: autotextarea. I'd like to teach it one little new trick: to resize initially to compensate for text that is provided in the form, rather than waiting for the first keystroke. Can some kind soul please tell me what sort of handler to add to it in addition to the onkeyup? Here is the plugin in question...

Detecting jQuery Object

I'm writing a plugin for jQuery and I want to make it so the user can pass data to the plugin in any form. I have the JSON or array problem worked out, but I'm having trouble trying to determine if the data is a jQuery object. data = $('#list li'); console.debug( $.isPlainObject(data) ); // false console.debug( $.isArray(data) ); ...

trouble parsing yahoo API json with jquery

I'm having trouble parsing the following link. I'd like to be able to extract a few of the object characteristics from each object in the array using $.getJSON(). Does anyone have a clue how I can do this? Thanks! http://search.yahooapis.com/NewsSearchService/V1/newsSearch?appid=YahooDemo&amp;query=market&amp;results=2&amp;language=en...

Why does my .ajax request report ABORTED in Firebug?

I've got the following code $(function(){ $("#AddMaps").submit(function(){ var $form = $('#AddMaps'); $.ajax({ type: 'POST', url: 'test_multiple.php', data: $form.serialize(), dataType: "json", beforeSend:function(){ $('#ajax-panel').ht...

jQ, On dropdownlist change/selection, get request on same url with ?somekey=selected-item-value

When someone selects a drop down list item, I want to redirect to the same page but with the querystring set with www.example.com/?somekey=selected-value where selected-value is the numeric value of the option. I am using jqeury if that makes it easier. ...

Design of caching for a medium/small web app?

I have a web app that's currently ~700 LOC in JS (more is serverside). I'm using jQuery. As I find myself trying to minimize AJAX requests to the server, I've got an awkward mix of caching and spaghetti code developing. It feels like I need a more centralized solution. My idea: Create a map with the AJAX call to make (URL and args), and...

Implementing jquery upload plugin 'uploadify' with codeigniter

How can i implement this in codeigniter?Uploadify(Jquery) I mean what will be the controller? Hows the progress tracked? And what will happen if flashplayer is not installed by the user? And How do i check progess? Have any one tried this with codeigniter? ...

Jquery Fade In/Out Div Switcher Won't Display Right in IE

Basically how this is supposed to work (and does in firefox, safari, and chrome) is that there are three links in a list and when you click one, its class is used to find a div with the same name but in an id. That div is then faded in after all divs with a certain class are faded out (this div has to class as well as a catch all). here...

jQuery - running a function before document.ready... but not too early

I have a page which contains a div which must be resized via JS when a page loads. In order to do that I give it a "default width" of 760px and then run the following code: function resizeList() { var wlwidth,iwidth,nwidth; wlwidth = document.body.clientWidth - 200 - 60; iwidth = 320; nwidth = Math.floor(wlwidth / iwidt...

trouble parsing daylife json with jquery

Does anyone know how I would be able to access the "name", "url", "headline", "timestamp", and "excerpt" from the array "article" using the $.getJSON? http://freeapi.daylife.com/jsonrest/publicapi/4.8/topic_getRelatedArticles?topic_id=&amp;name=business&amp;start_time=2010-06-26&amp;end_time=2010-07-03&amp;sort=date&amp;offset=&amp;lim...

Reusable jquery ajax requests...

I am developing a web application using asp.net mvc... I am listing out the details of Clients,Staff,Reports via ajax requests using jquery... What i am doing is writing seperate functions(jquery ajax requests) for each actions (ie) view,add,edit,Delete ... //Clients function getClients(currentPage) { $.ajax({ url: "Clients/...

How to get the value of span tag based on css class in jquery?

How to get the value of span tag based on css class in jquery? <span class="page-numbers current">3</span> I used var pageno = $(".page-numbers current").val(); alert(pageno); it doesnt seem to work.any suggestion.. EDIT:i am using jquery pagination plugin for pagination... for first page 1 and prev are assigned css class class...