jquery

jQuery - Limiting server hits based on Last Key Press?

I'm looking to learn how to build something that detects key-presses in order to throttle a function. Something like: var LastKeyPress; function hitTheServer() { if LastKeyPress > 2 seconds ago { hit the server and do stuff LastKeyPress = now(); } } What do you think? Maybe this is built into jQuery? Also, its something that...

Object Expected error in IE7 - problem with function scope?

Hi - I'm having what I hope is a simple-to-fix issue. Basically, I've got one block of javascript containing the function, and then I'm trying to call it from another block of javascript (within a jQuery $(document).ready function). Whilst it works fine on Firefox, I get an 'Object Expected' error in IE7. It's probably something to do w...

JQuery: programatically added anchors aren't associated with my click function

I'm new to JQuery and I'm trying to use it to implement an enhancement in an old web application. I'm gathering a list of strings from a server and rendering each one of them in its own anchor tag such that they appear in a comma delimited list. I assign that generated markup to a span's inner html: $.getJSON("http://domain/restOfURL"...

Repeat/Clone a <tr> element using jQuery's clone() function

I am trying to clone a template of a which will be populated with data and then inserted into a table. I'm currently able to use the same .clone() function with other elements on the same page but jQuery refuses to see and clone the template (I'm guessing because its not a block element). Here is the template: <tr id="search_result_...

missing } after property list

I know this is something easy but I just can't see it. Can anyone tell me why I am getting the error "missing } after property list" for the following code: var $newCandleDialog = $('<div></div>') .load('/prodash/dash_access.php?urlInit=candles/getCanStatus.php','it='+newData) .dialog({ autoOpen: false, ...

jqueryui datepicker throwing error at code relating to zIndex

I am developing an asp.net page/application. I have created a textbox that i set as a datepicker using the datepicker from jqueryui. in firefox and chrome the datepicker does not render. in IE9 the date picker renders if i ignore the error. the error is at line 644 in jquery.ui.datepicker.js. the code where the error is thrown is ...

Questions on practical usage of ajax with jquery

I'd been reading up on implementing ajax with jquery. Am I right to say, $.ajax() is the only function we ever need? ie. we don't actually need the $.get $.post functions? Lastly, lets say we're building this ajax form, we should bind the $.ajax function to a submit button using .click? We don't actually need to enclose the button in a...

How to add and remove a current state to a link when another is clicked using jQuery

Hi there, it my first time here - please go easy on me! I am struggling to find an answer to my question which is: How to add and remove a CSS .current class to a link when another link is clicked. For example, using this code: <a class="boldthislink">Bold me?</a> <a class="boldhim">bold him</a> <a class="unboldhim">unbold him</a> I...

jQuery UI dragging nested sortables to sortable tab

I'm combing a lot of things jQuery's UI can do, up to a point where I got lost... I set up a sample at http://jsfiddle.net/Patrick/uAKvx/. let me know if you have a problem getting to that. Anyway, I am able to order links and drag 'em to other windows, and I'm able to do the same with windows and columns. What I want is to be able to d...

Primefaces, JavaScript, and JSF does not work well together or am I doing something wrong

Here is something so simple <p:commandLink value="Tom" onclick="document.getElementById('tom').focus()"/><br/> <input id="tom"/> When u click on the Tom, the textbox get focus. Great, now try this <p:commandLink value="Tom" onclick="document.getElementById('tom').focus()"/><br/> <h:inputText id="tom"/> <br/> when I click nothing ha...

KnowledgeBase article creation mechanism for php, jquery, mysql

I am looking to create a general knowledgeBase for my customer service department which takes information (my thought is from a mysql database) and populates a page with that information based on the content pulled. Take this site for example: ToastMaster I would like to store a primary title, main content, images, etc on my site witho...

Contenteditable adds a <br> when I hit space

I'm not sure why, but if you have an element with contenteditable enabled, the first time you enter a space, it'll append a <br> tag into the element. If the element has a space in it by default (<p contenteditable="true">this is a test</p>), it'll be fine, but as soon as the user hits that spacebar (or even copy+pastes a space characte...

Set default button on html elements with jquery plugin

I am looking at writing a jquery plugin that takes a number of input elemts such as input elements, textareas, select html elements etc and once the enter key is pressed in any of the above items, a input button is triggered. As such, the button is set as the default for the fields. Any tips on doing this? ...

jQuery qtip doesn't draw little arrow tip in IE8 (or IE7)

I'm using jquery's qtip plugin to draw a tooltip, and it works fine on FF but not on my versions of IE. It looks like for IE, the plugin uses vml tags instead of canvas tags. Is there something extra I need to include in my page to get the little arrow tip to show? Here's my simple html page; note that when you mouse over "tooltip tar...

FireBug: How can I get rid of annoying messages?

FireBug always shows warning messages from jQuery eg reference to undefined property o.cache[H][E] (function(){var l=this,g,y=l.jQuery,p=...ch(function(){o.dequeue(this,E)})}}); jquery.min.js (string 12) Can I set up FireBug not to show certain warnings for certain scripts? ...

Prevent redirect after form is submitted

I have an HTML form that submits an email with PHP, and when it submits, it redirects to that PHP page. Is there a way to prevent this redirect from happening? I built an animation with jQuery that I want to occur instead of redirecting. I tried return false;, but it wouldn't work. Here's my function: $(function() { $('.submit').cli...

Parsing an RSS feed with jfeed fails only for some fields

I'm using the latest version of jFeed with the latest jQuery. I know jFeed is rather outdated, and no longer supported, but firefox seems to be the only browser that is having an issue parsing an RSS feed using this setup. I've modified jFeed to pull a 'date' field which is in the XML node "dc:date". The only thing I can think of is fire...

How do i only make a button active if at least one yes?

So i have this structure <div class="accordionContent"> <form action="/make_requests" class="make_request" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" /></div> <tr> <td>Enter Sandman</td> <td>2</td> <...

Need help with jquery validation plugin submitHandler redirect

I am having problems using the jquery validation plugin's submitHandler. I am working within the confines of some code that I do not have access to change so I am trying to find some work arounds. This is what I would like to do... After the form validates, when the user clicks the submit button, and it is successful redirect the page...

Pass along get params?

I want to use ajax to retrieve some JSON from another page, but I want to pass along the same GET params that were used to request the original page. How do I do that? Does JS store them in a dict somewhere? Or is there a jQuery solution? $.ajax({ url: 'mysecretwebpage.com/supersecret', data: ??? }); ...