jquery

rawurldecode and regexp for splitting words with and without quotes in javascript?

so here is the case: i have a string in php (containts 2 words): windows "mac os" i encode it with rawurlencode and put it in the URL after ?name= in an anchor. when i click it i see the following in the browsers url. index.php?name=windows%20%5C%22mac%20os%5C%22 and then i get it with javascript with jquery bbq. var string = $.de...

In IE 6/7/8: HTML inserted into <p></p> (with jQuery) not conforming to set width of the <p></p>.

So I've got this markup: <div id="text-container"> <p></p> </div> with this style (redundant, I know): #text-container {display:block: width:220px; height:280px;} #text-container p {display:block; width:220px; height:60px;} and this bit of jQuery plugging simple content into the paragraph: $("#text-container p").text(data); Wo...

Resize jqGrid based on number of rows?

I want my jqGrid to shrink and expand based on the number of rows it has. Let say it currently has 10 rows, the height of the jqGrid will shrink to 10 rows (so that no gaping empty rows is exposed). If however there are too many rows, the height of the grid will expand to a maximum 'height' value and a scroll bar will appear. ...

JQUERY BIND to a LABEL, and pass the name & value Take 2

Given the following HTML: <p id="noteTypebox"> <label for="noteType_1" class="notetypelabel active" id="noteType_1"> <input type="radio" name="noteTypeID" value="1" checked="checked" class="notetype">Project Meeting</input> </label> <label for="noteType_2" class="notetypelabel" id="noteType_2"> <input type="radio" name="...

How do I insert a $variable into jQuery

I'm working in Drupal with jQuery. How do I insert a php $variable into a tag. $(document).ready(function(){ $("#comment-delete-<?php print $variable ?>").click(function(){ $("div.comment-<?php print $variable ?> span.body").replaceWith("new text"); }); }) or $(document).ready(function(){ $("#comment-delete-". $va...

Obtaining YouTube video ID in a URL and inputting selected video ID into a URL

I've been having trouble in trying to figure this out. What I am trying to do is, obtain the ID of a video from YouTube, and input the 11 character ID into the css of a div of a specific id by using jquery. I know the URL for the thumbnail of any video, but I just need to be able to change the ID to display different video thumbnails. <...

jQuery action whenever any select is changed

Using jQuery, how can I make it so that a function is called whenever any select object on the page is changed? ...

php validation using jquery and ajax

Hi, i have a jquery ajax form. i have validation at server side for repeated username and email ID. which works fine without jquery/ajax. in my php code i have used die() to return if any error occurs. my main problem is at ajax here is the code $(document).ready(function(){ $("form#regist").submit(function() { var str = $("#regi...

Column total NAN error

I am using this bit of code to add the values in a table column which works pretty well until it encounters a null td cell with a   value. From that point on in the loop, I receive a NaN error in my alert. I'm wondering how to ignore these non-numeric values or replace them with zero for the calculation? Thanks jQuery(function() { ...

How can I count a page views?

How can I count page views so that when I go and refresh the page the counter doesn't consider it as new view? ...

Multifile plugin - help

Hi, I am using Multifile plugin to select the multiple file. I am trying to get the final file count for each browser selection . Any help is appreciated. Here is the sample code i am using <html> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery.MultiFile.js"></script> <script>...

Dynamically Including jQuery using JavaScript if it's not already present

I'm writing a little JavaScript tool for myself that I plan on making available to other people and it uses jQuery. My dream for this little utility is for people to be able to include a single .js file from a remote source and, when that file is loaded, have it check to see if jQuery has already been included and, if it has, make sure i...

How to prevent onbeforeunload from being called when clicking submit button

How can I prevent onbeforeunload from being called when clicking the submit button? $(document).ready(function() { $('input:text,input:checkbox,input:radio,textarea,select').one('change', function() { //('BODY').attr('onbeforeunload',"return 'Leaving this page will cause any unsaved data to be lost.';"); if( window.onbe...

JQuery: mousemove fade in/out element.

I have a video player page and want the playlist div to only fade in when the mouse is moving, and fade out if the mouse is idle for 3 seconds. The div's class is "fadeobject" and it's ID is ""video-chooser" ...

URL Hash modification after document.write()

Hi!, I download via jQuery AJAX a whole html webpage. I want to replace the content of the current page with the one downloaded via ajax. I do it with document.write(). It doesn't work correctly because whenever I try to modify the hash, the webpage is reloaded. I know in IE it it necessary an iframe, but that is not the problem, becau...

JQuery and RadioButtons question

Hi, I have a table containing radiobuttons (i.e. 3x3 grid) and I want when I select one of them the containing the radiobutton to change colour. Following this example I did this <table class="table-name"> <tr> <td> <span>Some text</span> <input type="radio" name="some-name" /> </td> <td> <span>Som...

Check if any checkboxs are checked in jQuery?

I have a form.html: <div id="tag_option"> <li><label for="id_customer_type">Customer type:</label> <select id="id_customer_type" class="required" name="customer_type"> <option value="" selected="selected">All</option> <option value="NGO">NGO</option> <option value="...

Override TAB inside a Browser

If I'm typing text in a input field and press ENTER the default behavior of all the browsers I know is to submit the form, however if I press ENTER inside a textarea a new line is added. Is there any way to mimic this behavior (indent, not submit the form) whenever I press TAB inside a textarea? Bespin seems to do it, but in a canvas el...

How to raise Jquery Events and handle them?

I have a page with a widget in it. There is no cross scripting. I want to use Jquery events to communicate between the two. How can I raise a jquery event on a div in widget and then catch it in widget and do something with it? Any examples or code snippets would be really helpful. ...

change/modify the dropdownlist text by value using jquery

i have dropdownlist with the values: <select id="myddl" name="myddl"> <option value="1">One</option> <option value="2">Twooo</option> <option value="3">Three</option> </select> I need to change the text Twooo to Two using the value of the dropdownlist option(2). How can i do it in jquery? ...