jquery

removing inner div but not its content [fastest way]

i have html structure like this <div> <span class="ic"> <span class="ic">12345</span> </span> </div> i want to convert it <div> <span class="ic">12345</span> </div> ...

Javascript text input fields that display instruction text

What's the best way to have a text input field that displays instructions of what to enter in that field in gray. When you focus on that input field, the gray instruction text disappears and your input text appears black. If you erase your input text and focus away from that input, then the instruction gray text reappears. I've tried ...

Posting value to server using jquery ui-autocomplete and jeditable

Hi everyone, I recently upgraded jQuery to 1.4.2 and jQuery-UI to 1.8.2. Mistake or not, I started pulling my hair when I tried combining the new ui-autocomplete (not the old one from bassistance.de) with jeditable. When I edit a field in my page (usually a span with a unique ID), user starts typing the name of someone and I manage to ...

Resetting Pagination on AJAX destroy.

I am using will_paginate for paginating my results. Most of my site is AJAXified. All the records in the view can be edited/deleted in place. These records are paginated. I would like to know if there is any way to reset the pagination on AJAX destroy. For example, say i have 20 records, with 5 records shown per page. If the user delete...

If statement does not work

Ok i have this function. what it should be doing it looking for pid in sql and if found skip the function and move on, but I dont think my if statment is working right. function getblogpost(div) { var date = $(div).find('.time').text(); var user = $(div).find('.user').text(); var title = $(div).find('.title').text(); ...

Is is possible to use jquery datepicker for fetching data from db on selecting particular date ???

Hi, I'm using the JQuery DatePicker for exchange rate dashboard.How can i retrieve data on clicking specific date.The datepicker should fetch data from database and should display on text fied. The dates should be mark and clickable, and it should navigate to the particular Day Exchange rate Detail when the user clicks on one of the dat...

Javascript/Jquery - How do I get the element that the user has selected with their cursor?

If the user highlights the text within an <h1> with their cursor, how do I get that <h1> object? Or if they selected text within an <li>, how do i get that <li>? ...

Trouble binding JSON data to JqGrid

Hi All, I am having a lot of trouble binding my Json data to a JqGrid. In my Default.aspx.cs I have the following method : [WebMethod] public static string GetData() { CustomerHelper C = new CustomerHelper(); var data = C.GetAllCustomersSerialized(); return data; } The "C....

I want to click a button to toggle div slideUp & slideDown and quick anywhere else on the page to close the div

I have a button #clickme. When clicked a div #cart slides up, when clicked again it slides down. I also want to be able to close it by clicking anywhere else on the page apart from #cart or #clickme. The code I've attempted doesn't quite work. What happens now is that when I click #clickme, it slides up and then back down again quickly...

Dynamically populating a dropdown with jQuery

Good Day, How do I remove all the values from a dropdown list using jQuery? idnum = "item-7"; which populates a dropdown with 7 items. I could have an "item-3" which would populate a dropdown with three items. What I'm trying to do is select a button which could have an id value of "item-X" where X is the number of entries to popu...

Problem in integrating .js files for lightbox with previous ones

Hi guys, i am really messing up with this, could somebody help me here, please. what i am doing? -> I have developed an app in which I need lightbox effect(overlay) i.e when user will enter his name and click the button, he'll be shown a lightbox(simply telling him that process is going on. you need to wait.), he can then close the bo...

Pass value from page to a Jquery POpUp?

I have a Jquery POpup which calls a page internally .Page has a bound repeater on that.I need to acess the Page's repeater from the popup.How to acheive this? Thanks ...

fancybox: higher than viewport?

I am using a fancybox to show some inline content on a listview. My problem is, that when the inline content is higher than the viewport, fancybox creates scrollbars inside the lightbox - but this is not the desiered effect. Instead i would like the lightbox/fancybox to addapt to the inline content, so that the scrollbar will be in the b...

How to close an iframe from inside that iframe

I have a an iframe with content from another PHP page on my server inside a modal window. I would like to figure out a way how to close the modal box with the iframe from inside the iframe. I am using this modal window plugin: http://opensource.steffenhollstein.de/templates/modalbox/ According to the documentation this method closes th...

jQuery .load problem

Hello! Here is my code : <script type="text/javascript"> function show() { var text=$("#text").val(); $("#output").load("index.htm"); } function send() { var text=$("#text").val(); $.post("new.php",{'txt':text}); $("#text").val(" "); } </script> </head> <body onload=...

button click event is triggered after keypress using jQuery

I have these codes $('#search-button').keypress(function (e) { if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { search(); }; }); $('#search-button').bind('click', function () { search(); }); under the search module I have an alert, now whenever I press Enter when the button is in focus,...

Attatching setTimeout() to window.opener from window in unload callback

Hi, I'm trying to do this: $(function() { var parent = window.opener; $(window).bind('unload', function() { parent.setTimeout(function() { parent.console.log('Fired!'); }, 200); } }); The example above works well in FF, Chrome etc. but not IE8. In the latter, the callback specified in setTimeo...

on first load no javascript work at all

I am having strange problem, whenever my site is loaded for the first time in the browser, its jquery and slider doesnt work at all........ then when i refersh the page it loads it properly.... I am using Firefox latest 3.6.8 version CSS is loaded before jquery and slider scripts here is the link for website link text I fixed the butto...

how to refactor this jQuery(only AJAX URL different)

function one(R) { # do some thing.. $.ajax({ 'url': '/one?search=' + R.val(), #some thing common here } function two(R) { # do some thing.. $.ajax({ 'url': '/two?search=' + R.val(), #some thing common here } well, since I'm just doing jQuery, but I guess this can get improve, refactor? ...

jQuery LavaLamp: How to move/set the lavalamp highlight on required LI using hyperlinks outside the lavaLamp

Now this question has been asked before but I am not able to get the answer. I have a Lavalamp with 4 LI inside it, clicking on each of them loads some content in a div. It works all fine. Now I have a hyperlink somewhere on the same page outside of that lavalamp. I want that, when I click on that link, the lavalamp highlight should m...