jquery

jquery XML feed reader that passes in username/password

I'm looking for a jQuery solution that will allow me to read an XML feed that requires authentication. I have something that partially works, but I don't know how to pass credentials when calling the XML feed. I know that ideally I shouldn't put credentials in jQuery but they are innocuous in this instance so it's ok. ...

jquery hover event between mousedown and mouseup - possible?

If you imagine in microsoft paint you can click and hold to paint in an area, id like to do a similar but adding a class to cells in a table: (note this isnt for painting/art just an easy way of explaining it!) the following isnt working... $(function(){ $('td').mousedown(function(){ console.log('down'); $('td').bind('ho...

How do I add a destroy method in jQuery CoolInput?

I am looking at: CoolInput, but I need a destroy method. I want to be able to do something like this: $('#manualhint2').coolinput('foobar'); but I also need a method like: $('#manualhint2').coolinput(destroy); or something like that, because there are times when I need to disable CoolInput. Can somebody please help me? Or, ...

Handling JSON and HTML templates in jQuery

How do you handle templating HTML and JSON without locking the HTML into javascript strings? I have an ajax-enabled site that presents a lot of dynamic content by interpolating JSON values with HTML. This all works fine. BUT it means I have significant amounts of HTML all through my JavaScript. For example: var template = "<div>Foo:...

Set the focus on Popup Panel

Hello, I use a modalpopupextender to show a popup when the user clicks on a button. <ajaxToolkit:ModalPopupExtender ID="mpe1" runat="server" TargetControlID="statusInfoLb" PopupControlID="statusInfoPanel" DropShadow="false" OkControlID="okBtn" OnOkScript="onOk()"> </ajaxToolkit:ModalPopupExtender> <asp:Panel ID="statu...

jquery - get url path?

I know I can use window.location.pathname to return a url, but how do I parse the url? I have a url like this: http://localhost/messages/mine/9889 and I'm trying to check to see if "mine" exists in that url? So, if "mine" is the second piece in that url, I want to write an if statement based on that... if(second argument == 'mine')...

jQuery Cluetip not activated until after hover or click event

I'm not sure what is causing this, but I am using cluetip and binding it to a live event (either click or mouseenter), but in each situation the cluetip isn't firing until after one click or hover event. I am using the live event for ajax loaded content, but I'm also having this issue with non-Ajax loaded content. I'm not sure why this i...

Implementing a multi-state planner

I've been asked to develop a system wherein employees can mark on a form their availability on a given day of the week - for instance an employee could mark themselves as available on a given time on a given week, and unavailable on some other time. It looks a little like this: Currently this works by rendering checkboxes within the t...

jquery: most efficient way to get and store the ids of 100+ td items?

Ok so I have about six of these calendars on page, so thats around 180 td items (1 for each date): each td has an id that is equal to that day's timestamp. the dates I want are the red ones (class of .booked). So i need the fastest way to 'serialize' the ids for td.booked items, any ideas? ...

Check if a selector have a certain set of classes

Hello I'm trying to be able to check if a selector have a certain sets of classes. .hasClass() can only check if the selector has one class. And the .is() selector can look for multiple classes but will return true if the selector have at least one of the classes. But I wan't to achieve a way to check if a selector have both of the c...

how to get the value from a textbox that is next to my text

i have an html page where i have a table of items (one item per row) where each item is a html link that says "Add" and there is a textbox next to each link with a number in it. the text link and the textbox are in the same td inside the row of the table. how do i, using jquery, capture the value from the textbox that is to the right o...

Selected value from drop-down list doesn't post from jquery dialog

I have a jQuery dialog. All of the fields are posting correctly except for the drop-downs, the value is getting passed as null rather than the selected value. <div id="popupCreateCompany" title="Create a new company"> <form> <fieldset> <p> <label for="company_name">Company Name:</label> <%= Html.TextB...

JavaScript: A BackSlash as part of the string

Hello all, I have a JavaScript variable that I echo out using PHP which is shown like this in the page source: var db_1 = 'C:\this\path'; When I set the value of a text field with that variable like so: $('#myinput').val(db_1); The slashes have disappeared and only the other characters are left! Why is this and how can I put the ...

onchange on dropdownlist

my qeustion is continuation of what i have asked see the link. http://stackoverflow.com/questions/2640001/load-country-state-city i have expand to load my drop downs list from db and i just need a way to wire onchange method in my first dropdownlist and second, please see the code. appreciate any help. Append latest code: <select id="...

POST serialized JSON object to a Coldfusion remote method instead of using FORM

I have javascript object which consists of complex array of structures with nested structures of other javascript objects created dynamicaly on page etc. long story. I can't use form since my vars would be like 2_34_x_y_foo_bar_235423 due to the nature of UI. When I send that stringified object using GET .ajax request to a remote cfc me...

asp.net external form loading into jquery dialog submit button issue

I am loading an external file 'contact_us.aspx' into a jquery dialog box. the external page contains a form. When the submit button is pressed it closes the dialog box and changes the page to contact_us.aspx. is my code correct or is there a different way of doing this. see my code below, thanks. This JS is in y masterpage: <script...

pass parameter from $.post() callback to outer variable

basically i want to hold a parameter that retrieve value from $.post() call like this: init = function(){ var lastpage = getLastPage(); } function getLastPage(){ $.post("getInfo.php",{ last: "yes" }, function(data){ setLast(data.last); },...

jQuery Autocomplete plugin - How to dynamically update data list?

Hi, I am using the jQuery autocomplete plugin for a smart input box. I want the first parameter in the input box to be autocompleted from one dataset, then once that has been selected change the dataset for the second parameter. So if I have the following: var foo = ['a','b','c']; var bar = ['x','y','z']; $("#input_box")....

Call load using a div id that has been passed into a function, div id is a parameter

I am dynamically creating divs within a jquery accordion that are loaded with data as when the user clicks on the accordion title. I have this all working except that when I pass the div id into the load details method, the call to .load() does not work. What can I do to fix this? It seems like a simple javascript string eval would work ...

How to simply encode and decode a string variable with javascript.

I need to simply encode a string variable (my api key) so that is not easily readable by human eyes, I need it to easily decode back to exactly the same initial string. What is the standard practical and fast (less computing on the user side) way to do this? Many thanks in advance! ...