jquery

jquery separate js files

Hi, I have 2 separate js files: //first.js $(document).ready(function(){ $("#someButton").click(function(event){ showMessageBox("test"); }); }); and the second $(document).ready(function(){ alert('csdfsdf'); function showMessageBox(msg) { alert("something"); $('#messageBox').text(msg); $('#messag...

jQuery datePicker can't get val()

Hi, I'm puzzled by the jQuery UI datepicker. I have the following function: $(".text-date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd" }); $("#regdatum input").change(function() { alert('Regdatum from: '+$("#filter-regdatum-from-value").val()); alert('Regdatum to: '+$("#filter-regdatum-to-value...

jquery: $(window).bind('load', function()) and $(document).ready(function()) in ajax loaded content

I am using facebox (http://famspam.com/facebox) to hold some content loaded via an ajax call. The content being loaded has a jquery ui slider element inside of it. In non-ajax loaded content I can use either the $(window).bind('load', function()) or $(document).ready(function()) methods in order to trigger the construction of the slide...

Replacing Colspan = "2" with Colspan = "4" using Jquery

Hi, <table cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse;" id="ctl00_ContentPlaceHolder2_FormView1" class="innerGridTable"> <tbody> <tr> <td colspan="2"> <tr> <td> <b>VenueID:</b> </td> <td> ...

AJAX only access

I have recently started to code heavily AJAX supported scripts in PHP, thing is, the files being accessed by the AJAX calls can be directly used too, how to disable that? ...

JQuery .each() backwards

Hi, I'm using JQuery to select some elements on a page and then move them around in the DOM. The problem I'm having is I need to select all the elements in the reverse order that JQuery naturally wants to select them. For example: <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> </ul> ...

jQuery plug-in with additional methods.

I've a jQuery plug-in that operates on some ULs, adding and removing classes etc. During the life-cycle of the page, I'll need to add/ remove some classes in code, and as my plug-in needs to perform some additional operations when this happens I came up with the following: // This is the initialiser method... $.fn.objectBuilder = funct...

Simple Scrolling with jQuery

I have an AJAX navigation and I would like to scroll the page to the main title when the user clicks a link. Let's suppose that the title has a #sampleid: I would like to do something like scrollTo #sampleid. How can I do that? ...

jQuery hide/show doesn't seem to work - am I doing something wrong

I am trying to show an element (which is a table, but I am using it as a div) when a submit button is clicked. It doesn't seem to work. And I don't think that's because of bad CSS Karma acquired by using tables for layout. Code is as follows: $(document).ready(function() { $("#object-created-panel").hide(); $("#create-o...

How can i check whether any child of container div has an error class by using JQuery ?

Hi, Suppose the following HTML div container <div id="container"> <form> <div> <label class="error">Name</label> <input type="text" name="name"/> </div> <div> <label>Age</label> <input type="text" name="age"/> </div> </form> </div> How can i chec...

ASP.NET MVC Session using jQuery

PROBLEM SOLVED: I was overlooking a very simple issue, and that is that this is actually two different apps running under one website. I modified the URL in the AJAX call slightly to reflect that and the problem is no longer happening. ORIGINAL QUESTION: I'm having a weird issue and I'm hoping someone can help shed some light on the s...

jQuery treeview with sortable

Hi there, I was just wondering if anyone knows of any way to get the bassistance treeview plugin to work with jQuery UI's sortable plugin? Particularly in terms of being able to drag and drop the element from it's nested ul to the parent ul or vice versa. Two other requirements are that I have the ability to prevent dropping onto specif...

How to select the first element in the dropdown using jquery?

I want to know how to select the first option in all select tags on my page using jquery. tried this: $('select option:nth(0)').attr("selected", "selected"); But didn't work ...

How to create a dialog using jquery

I am basically trying to achieve what this page has: When clicked on an image, it should pop out, make the back screen black, and have a close button. I've seen lot of sites with this. Does anyone know which jquery plugin could be used for this? ...

Rounded corners mess up on a collapsible div in IE7

Hi,I have a div that is display: none on page load. I also have a button that toggles the display of the div (none to block). The first time after pageload that I click the button and show the div it has the assigned rounded corners (pic. 1 and 2). Then I click again to hide the div and click to show it. After that the rounded corners me...

how do i put jquery code inside a html document? (lightbox)

how do i make the jquery show up in an existing html document. mainly the jquery lightbox plugin edit: ? how do i reference? ...

IE jQuery problem

HTML: <div id="media-photo"> <img src="/uploads/photos/16.jpg" alt="" /> </div> <a href="/uploads/photos/5.jpg" class="img"> <img src="/uploads/photos-thumbs/5.jpg" alt="" /> </a> <a href="/uploads/photos/6.jpg" class="img"> <img src="/uploads/photos-thumbs/6.jpg" alt="" /> </a> JQUERY: $(document).ready(function() { ...

Processing XML with jQuery cross-browser

I am new to jQuery and am having cross-browser inconsistencies. I am trying to populate an HTML drop down using jQuery to parse the XML document. Eventually, I will swap the XML document with an HTTP call, but for now, I am doing a GET of the local XML copy. My approach works in Firefox (2 elements show up in the drop down) but IE7 isn't...

jQuery Dialog not appearing when called.

I am trying to get a modal loading dialog to pop up while I make an ajax call but it is not showing up in the onClick function. If I slow it down with firebug and step through the loading panel will show up. Is this just javascript running ahead of itself? Is there a better way to do this? $(function(){ $("#loading_panel").dialog({...

Close popup (div) jquery

Hi, I have a div which appears when a textbox gets focus. DIV has n number of textboxes. I want to say display:none when a user Clicks anywhere in the window. Div should not close if the user is switching between textboxes. All these jquery plugins, say the calendar control closes if user clicks outside. How is that happening? Any i...