jquery

Formatting and pretty printing dates with jquery

I need to display dates in a couple different ways in an app built with jquery. In some situations, I need the typical "yyyy-mm-dd hh:mma" type of formatting, with all of it's different permutations. In other cases, I need to show dates "pretty printed" similar to how StackOverflow does them: 5 seconds ago 12 minutes ago 3 hours ago y...

jQuery autocomplete: taking JSON input and setting multiple fields from single field

I am trying to get the jQuery autocomplete plugin to take a local JSON variable as input. Once the user has selected one option from the autocomplete list, I want the adjacent address fields to be autopopulated. Here's the JSON variable that declared as a global variable in the of the HTML file: var JSON_address={"1":{"origin":{"name...

is there any reference you consider a basic ajax reference to create a popup menu ?

i would like know some reference. I know i can googling it. but prefer from your point of view and your understanding what is the basic one...thanks ;D ...

how to restrict anonymous data while using jquery autocomplete plugin

Hi, I am using jQuery autocomplete plugin. I want to restrict the user to select the options only available from autocomplete list and he cannot enter the non available. And the data for autocomplete is from the server and not local. Is there any option to implement it. ...

Make a run away button in jQuery

Hi guys, I wanted to create a page with a simple button which runs away from the user when he tries to click it. Lets call it the Run away button? Is there a simple 'jQuery' snippet which will allow me to do the same? Regards, Karan Misra ...

Adding "this" to the parents stack for "each" in jQuery

This question is a bit of a two-parter. First, the title question. Here's what I've got: // Report all of the parents $(this).parents().each(function(i){ // Collect the parts in a var var $crumb = ''; // Get the tag name of the parent $crumb += "<span class='tagName'>"+this.tagName+"</span>"; // And finally, repor...

jquery getjson dtree

Has anybody try to use dtree combine with $.getJSON ? all pages seems blank the only thing left is the tree, i think its because document.write...any help ? ...

How to show mouseover tooltip on selected word on web page using javascript, conditionally?

How to show mouseover tooltip on selected word on web page using javascript? i want to set some conditions For example: If page has text <p> I'm Web Designer </p> inside <div id=example> then it should show tool tip on Designer but tooltip should not be shown for designer without adding any span to Designer and designer. i want to sele...

jQuery validation: how to output error message to jQuery UI modal dialog

How can I change the error message of jQuery validation so when it validates the error is composed as bullet points inside a jQuery Ui modal dialog. Tried this but it doesn't work as expected (i.e. the modal dialog only apperas once, but after it is closed, I can't bring the modal dialog back when submitting invalid data for second time...

How to add brackets (a) to ordered list? compatible in all browsers.

I have to show like (a) (b) (c) Update: I found a CSS way ol {list-style-type: none;} li:before {content: "(" counter(section, lower-alpha) ") ";} li { counter-increment: section;} but it not works in IE 7 and lower. ...

jQuery - get neighborhood element

I need to get neighborhood element value. HTML is <div> <input type='hidden' value='12345'> <div id='click-this'>Click me</div> </div> How can i get "12345" by clicking "click-this" div ? $('#click-this').click(function() { ??? 12345 ??? }) ...

getComputedStyle (or) $.css(map) <-- to get every style declaration

Aside from looping through an array that has each style property declared, is there any way to get a key/value output of all styling of a dom element? My fallback is iterating through the keys listed on: http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSview-getComputedStyle ...

session timeout with form authentiation, how to display an modal poup or redirect entire page

I am using asp.net mvc and jquery to make ajax requests and when the session times out after an ajax request the full sigin page gets loaded into my ajax div. How can I display a modal popup instead of making a redirect when a session times out? ...

Jquery callback function executes over and over again...

This my jquery function, function getRecordspage(curPage, pagSize) { // code here $(".pager").pagination(strarr[1], { callback: function() { getRecordspage(2, 5);},current_page: curPage - 1, items_per_page:'5', num_display_entries: '5', next_text: 'Next', prev_text: 'Prev', num_edge_entries: '1' ...

jQuery Accordion expand all div

Is it possible to expand all components when page is load or when an event occurs? Thanks!! ...

Stream data with Node.js

I want to know if it is possible to stream data from the server to the client with Node.js. From what I can understand all over the internet is that this has to be possible, yet I fail to find a correct example or solution. What I want is a single http post to node.js with AJAX. Than leave the connection open and continuously stream dat...

How to make this css code (counters and ;before) cross browser compatible using jquery?

How to make this css code cross browser compatible using jquery. this code only works on firefox and IE8. i wan to use in IE6 and 7 also. ol {list-style-type: none;} li:before {content: "(" counter(section, lower-alpha) ") ";} li { counter-increment: section;} this is html <ol class"fnotes"> <li> item 1 </li> <li> item 2 </li...

Doing a "Diff" on an Associative Array in javascript / jQuery?

If I have two associative arrays, what would be the most efficient way of doing a diff against their values? For example, given: array1 = { foreground: 'red', shape: 'circle', background: 'yellow' }; array2 = { foreground: 'red', shape: 'square', angle: '90', background: 'yellow' }; How would I ch...

jQuery select elements with value between x and y

Hello <input value="1" /> <input value="10" /> <input value="9" /> <input value="4" /> <input value="5" /> I'd like to be able to do that kind of selection: $('input[value between 6 and 11]'); Which would give me the 9 and 10. Is there a way to do that ? ...

Ajax cross domain call

Hi Folks, I know about ajax cross-domain policy. So I can't just call "http://www.google.com" over a ajax HTTP request and display the results somewhere on my site. I tried it with dataType "jsonp", that actually would work, but I get a syntax error (obviously because the received data is not json formated) Is there any other possibli...