jquery

How can i set my background color through HTML5 getItem?

Im using this code: $(this).css('backgroundcolor', localStorage.getItem('bgColorr') + " !important;"); When i write: alert( localStorage.getItem('bgColorr') + " !important;"); It gives me the proper alert, rgb(243,102,42) !important; .... Really getting to me.. thanks guys! edit: Surrounding code: $(function() { $(th...

How do I add a function to a specific element type in jQuery?

I can do this jQuery.fn.validate = function(options) { var defaults = { validateOPtions1 : '', validateOPtions2 : '' }; var settings = $.extend({}, defaults, options); return this.each(function() { // you validation code goes here }); }; but that will make validate() available for every el...

Create a jQueryUI 1.8 Button menu

Now that jQueryUI 1.8 is out, I was browsing through the updates and came across the new Button widget, and in particular one of the demos with the SplitButton with a dropdown. This demo seems to suggest that the Button widget could be used to create a dropdown menu here. As a matter of discussion, I was wondering what ways there are to...

Gaining Reference to the Dialog from Dialog content

Here's my scenario: I've got a div on Page A. When an event happens (whatever I define, a click, whatever), I do a div.Dialog, set its properties and open it The data inside is returned from an async .ajax call that grabs the data from a url and appends it to the div by calling div.html(data) inside the .ajax callback, so it's essentia...

How to reference an anonymous JavaScript function?

I'm trying to call a Page Method using a jQuery 'attached' event function, in which I like to use the closure to keep the event target local, as below, but page method calls declare several 'error' functions, and I would like to use one function for all of them. If, in the below code, I was handling an error and not success, how could I...

jquery tabs dissapear when re-clicked

Here is my test page (dont mind the layout right now) https://www.bcidaho.com/test_kalyani/employer-plans-test.asp i found something weird. if you click back and forth between tab 1 and tab 2, its fine. if you click tab 3, and got to another tab, the content dissapears... and i can not figure out why??? I am boggled, and can not fig...

How do I detect a text input's value and set a class with jQuery?

I would like to make sure if a textbox has any content at all, that jQuery can show it's parent (an <li class="hidden_dedication">) element and set add a class of 'shown'. I'm pretty sure that it should be something like this, but cannot get it to work: if ($('li.hidden_dedication input').val() !== null) { $(this).parent()....

Loading html dynamically using Javascript and PHP

I have the following code: <?php if ($x == 1){ ?> <b>Some html...</b> <?php } else if ($x==2){ ?> <b> Other html...</b> <?php } ?> Now I would like to have two links below (a href) and somehow pass the variable $x (so Link1 passes x=1 and Link2 passes x=2) in order to load the relevant bit of code from if...

Internet Explorer ajax request not returning anything

At the end of my registration process you get to a payment screen where you can enter a coupon code, and there is an AJAX call which fetches the coupon from the database and returns it to the page so it can be applied to your total before it is submitted to paypal. It works great in Firefox, Chrome, and Safari, but in Internet Explorer, ...

jQuery CSS menu not selecting the active link

What is wrong with this and how could I fix it? I have a CSS menu (horizontal) that I want the background and font to be changed when one of the items is selected. I found another post that gave me some jQuery code to help make it work, and I thought I had it coded right, but when I click on an item to change its class it adds the clas...

Can I select input nodes based on value in JQuery?

I have a list of file input boxes and I want to know if any of them have a value using a single selector statement. Can I do something like this: $('input:file[value!=null]') or something similar. ...

jquery change load get url

Ok so I have a php page with data dynamically outputs depending on a $_GET variable ['file']. I have another page (index.php) which has a jQuery script that uses the load() function to load the php page. I have a list of links and when you click on one, it needs to change the $_GET variable to load, then refresh the load() jQuery variabl...

jQuery / jEditable and jQuery UI Dialog. Re-populating table cell.

Hello, this is my first time using JS, so i really have no idea what i am doing. I have a table with data, and using jEditable to allow a user to edit the data and POST it to my php script. When user hits "Save", it opens jQuery UI with the data from php script and it seems to work fine, however, if the user hits Cancel or Esc to close ...

Ubiquity CmdUtils.setSelection won't replace HTML

I'm attempting to write a Ubiquity command that allows you to replace a selected link or URL pointing to an image with that image itself. However, the CmdUtils.setSelection() function (documented here) seems to do nothing if any html tags are present in the selection, making it useless for replacing any links. When selecting plain text, ...

jquery load links not clickable

ok i am loading a separate page with links in it, into a page named index.php. it loads fine, but when i click one of the links inside the loaded content, nothing happens. they dont act as links. but if i do a alert('hi'); after the load('page.html'); then it will work. any ideas on getting this to work without alerting something after i...

Text Hints with JQuery and JavaScript for loop

Hey guys! I'm developing a small app where i ask users to put some info. I want to show text hints in the input fields. I do this in a for loop... When the page is loaded, the hints are displayed correctly but nothing happens on 'focus' and 'blur' events... I'm wondering why since when I don't use a 'for loop' in my js code, everything...

Upload an image using class.upload.php via AJAX, display image in form using jQuery

I am using class.upload.php to handle an image upload from a form that submits employee details to a MySQL database. class.upload.php does EXACTLY what I want it to do, resize the image and rename it - what I am now trying to accomplish is to upload via Ajax after the user selects the file and then display it in the form while they conti...

why doesn't IE8 refresh textbox right away?(Jquery)

I have 3 radio buttons and one textbox in my page. These 3 radio controls represent corresponding choice and among them, the third one enables textbox that is disabled by default. If user clicks any one from the first twos after clicking the third, the textbox will be emptied(if user input any) and disabled again. The problem is, in IE, ...

How can I make a list self-arrange in an animated way based on periodic json updates ?

I have a list of complex entities (divs), that are scored. The list will be sorted based on updates from the server as the user fills out a form. What i haven't figured out is how to animate the entities into their new positions. I don't want to just refresh the list. Is there a magic JQuery technique that achieves this? ...

jquery change variable on click and update

I have a PHP page that uses a $_GET['file'] to determine what is outputted on the page. On a page called index.php I use a jQuery ajax function to load the PHP page inside index.php like so: $.ajax({ url: "data.php", data: {file: 'folder/'}, success: function(data) { $('#remote-files').html(data); } }); Think of this as a ...