jquery

should all javascript go into a separate js file

What is the criteria if certain jquery or regular javascript should go inline or in a separate js file? ...

jQuery - can I dynamically change an elements parent? A a new element and make it the parent of a selection?

Hi All, I have a div #someDiv, can I create a new element and make #someDiv be its child? Basically I want to wrap a new element aound #someDiv. How do I do this? $("#someDiv").appendTo($("<div id='newParent'></div>")); // The intent is to move #someDiv into the new container // The new container may or may not be in the same // posi...

jQuery and asp.net not playing nice together

Please refer to this page for reference: http://loadedgranola.valitics.com/_product_83484/blackberry_lime I have a jQuery script that runs to replace the h1 tags with a background image. It works great when the document loads but when I click "add to cart", after the javascript alert the jQuery styling breaks. Due to CMS restrictions I...

Appending text to the end of class names to make it obvious jQuery is utilizing those classes

Hello everyone, While developing a design using jQuery I stumbled across a problem. How would I know, without having to look through the javascript, if jQuery isn't doing a selector on a class in my HTML? That is to say, if I wanted to change the class to something else, I have no way of knowing if that class is being used elsewhere s...

post data error in internet explorer 7

i have following code which work fine in Firefox, Safari but not working in internet explorer, $.post(postFile, { usernamePost: username, passwordPost: password }, function(data) { if(data.status==true) { $("#message").html("Correct Username or Password"); $("#message").css({color:"green"}); else { $("#message").html(...

Jquery text field populating from database on clicking select option

I'am having a select option box,if i click on the select option,two other text below it should be loaded with data from database,based on select option id value.How to do this with php and jquery or cakephp and jquery thanks in advance ...

Google Map Timeline slider

What's the best way I can take multiple KML files (each representing a different date) and create a google map with a slider? ...

Scope problem with SetTimeOut

I don't know why but this code is not working ? Why would it not ? I guess it is because scope problem I am having here : function washAway(obj) { alert($(obj)); // says HTML Object which is fine setTimeout(function() { alert($(obj)); // says undefined $(obj).fadeOut("slow", function() { ...

Global callback for Ajax calls in JQuery

Is it possible to create and attach a callback which would get called whenever an ajax request completes regardless of whether the call was made using $.ajax, $.post, load or any other function? EDIT: The solution given by Nakul (using ajaxSuccess global event) is almost perfect. However I have a problem when using this with the load f...

Jquery - waiting for user input

im trying to make a popup that comes up to confirm a users action (deleting a row in a table, for example..). aiming at making the popup entirely HTML and Javascript. What i can't get my head around is how i would make the javascript wait for the users input, but still function for other javascript events. (other click triggered stuff, e...

JQuery/ajax page update help pls

Hi Am new to Jquery/ajax and need help with the final (I think) piece of code. I have a draggable item (JQuery ui.draggable) that when placed in a drop zone updates a mysql table - that works, with this: function addlist(param) { $.ajax({ type: "POST", url: "ajax/addtocart.php", data: 'img='+encodeURIComponent(param)...

jQuery open facebox if the user is currently active on the page?

as we can use facebox as popup. i want to open this POPUP if user is not active for last 30 min on page. and if user press close button or close the popup time will be restarted. ...

jQuery simple function wont work

Why wont an alert box pop up when happen when I 'Click me'? Im a total noob at javascript/jquery but im trying to learn a bit I just found this example in a tutorial but it wont work Look: http://removed edit: removed my site link since question is solved ...

Variables going beyond scope?

my code: <html> <head> <script type="text/JavaScript" src="jquery-1.3.2.min.js"></script> <script type="text/JavaScript" src="jquery.center.js"></script> <script type="text/JavaScript"> $(document).ready(function(){ $('a').click(function(){ popup_AskYN("Want me to tell you what 1 + 1 is?",function(){ ...

jquery animating multiple elements

Hi, I'm trying to do the following: I have two sets of DOM elements on a page. All elements in the first set carry the class display-element, and the second set of elements carry the class edit-element. Now I have a button (id=edit-button). When I click this button, I want all the display-elements to fade out, and all the edit-element...

jQuery - Need to access PHP array values received after a successful ajax POST operation

Hi all, PLATFORM: jQuery, PHP, mySQL WHAT I HAVE: I am using jQuery to process information from a form and send all the POST data to a php file that does several operations and returns an array of data along with other necessary data. One of the arrays is an array of an array. I need to access this array of array values in such a way...

jQuery ajax output as return of a function

I created a small php script that returns a mysql result depending on given post/get parameters. With this file I can now use the jquery.post or .get command to retrieve something from my database. The script always returns 1 value. So I tried to make a javascript function that returns the retrieved value from the database. This is wha...

detecting a click on an image inserted through CSS content url()?

Hi everyone, I am adding a "remove me" icon to all elements on my page with class "myClass": div myClass:after { content: url('remove-me-icon.jpg') } Then I am using event delegation to detect clicks on all these icons by listening for clicks on the containing element: $("#myDivThatContainsThoseOtherDivs").click(function(e){ if (...

Ajax. Is it possible to not use mysql_query again in a new file?

When I use ajax, I have to use mysql_query again to get information in that file which is for ajax. Can I do action without mysql_query like with include();? Ask if you don't understand, because I guess I asked not very properly. edited: When I try to reach ajax file, in that file I have to retrieve member information again. So, my ques...

Moving a div into another div

i have 2 main div: <div id="div1"> <div id="minidiv1">a</div> <div id="minidiv2">b</div> </div> <div id="div2"></div> I want move the minidiv1 into the div2 with jquery how can i do? ...