How can I change the text color with jQuery?

Place the following in your jQuery mouseover event handler: $(this).css(‘color’, ‘red’); To set both color and size at the same time: $(this).css({ ‘color’: ‘red’, ‘font-size’: ‘150%’ }); You can set any CSS attribute using the .css() jQuery function.

Parse RSS with jQuery

WARNING The Google Feed API is officially deprecated and doesn’t work anymore! No need for a whole plugin. This will return your RSS as a JSON object to a callback function: function parseRSS(url, callback) { $.ajax({ url: document.location.protocol + ‘//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=’ + encodeURIComponent(url), dataType: ‘json’, success: function(data) { callback(data.responseData.feed); } }); }

Should I use .done() and .fail() for new jQuery AJAX code instead of success and error

As stated by user2246674, using success and error as parameter of the ajax function is valid. To be consistent with precedent answer, reading the doc : Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks will be deprecated in jQuery 1.8. To prepare your code for their eventual removal, use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead. If … Read more

How to disable/enable select field using jQuery?

You would like to use code like this: <form> <input type=”checkbox” id=”pizza” name=”pizza” value=”yes”> <label for=”pizza”>I would like to order a</label> <select id=”pizza_kind” name=”pizza_kind”> <option>(choose one)</option> <option value=”margaritha”>Margaritha</option> <option value=”hawai”>Hawai</option> </select> pizza. </form> <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js”></script> <script> var update_pizza = function () { if ($(“#pizza”).is(“:checked”)) { $(‘#pizza_kind’).prop(‘disabled’, false); } else { $(‘#pizza_kind’).prop(‘disabled’, ‘disabled’); } }; $(update_pizza); … Read more

$.focus() not working

Actually the example you gave for focusing on this site works just fine, as long as you’re not focused in the console. The reason that’s not working is simply because it’s not stealing focus from the dev console. If you run the following code in your console and then quickly click in your browser window … Read more

jQuery append() – return appended elements

There’s a simpler way to do this: $(newHtml).appendTo(‘#myDiv’).effects(…); This turns things around by first creating newHtml with jQuery(html [, ownerDocument ]), and then using appendTo(target) (note the “To” bit) to add that it to the end of #mydiv. Because you now start with $(newHtml) the end result of appendTo(‘#myDiv’) is that new bit of html, … Read more

Should Jquery code go in header or footer?

Put Scripts at the Bottom The problem caused by scripts is that they block parallel downloads. The HTTP/1.1 specification suggests that browsers download no more than two components in parallel per hostname. If you serve your images from multiple hostnames, you can get more than two downloads to occur in parallel. While a script is … Read more

Changing the child element’s CSS when the parent is hovered

Why not just use CSS? .parent:hover .child, .parent.hover .child { display: block; } and then add JS for IE6 (inside a conditional comment for instance) which doesn’t support :hover properly: jQuery(‘.parent’).hover(function () { jQuery(this).addClass(‘hover’); }, function () { jQuery(this).removeClass(‘hover’); }); Here’s a quick example: Fiddle

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)