Saving a value and incrementing it using jquery
Hi All, I am making a LOVE IT button using php and jquery and i have most of it working... The button currently returns the value from the DB of 0 but when i click the button it wont save the incremented value to the DB. Please see it here http://bit.ly/dKx15z my code is this <?php mysql_connect("localhost", "web183-loveit", "password") or die ("Error."); mysql_select_db("web183-loveit") or die ("error"); $increase = "UPDATE results SET value=value+1 WHERE id=1;"; $active_rate = mysql_query("SELECT
Problem with reading jQuery XML in IE
It works in Chrome and Firefox but not IE! I really hate IE sometimes. I have tested this with IE 9. Essentially I have an XML formatted string: var xmlData = '<?xml version="1.0" encoding="ISO-8859-1"?><details><test>hello</test></details>'; I am then trying to access this string using: window.alert($(xmlData).find('test').text()); And returned is nothing. What am I doing wrong? The same code works fine on Chrome.
Load Widgets Dynamically
I'm dynamically building a tabbed interface based on the information that a user wants to see. When the page loads, I get an array of the names of the widgets that control the tab content and I load their script files dynamically. Currently I'm resorting to eval() to bind the widget. Is there a way to get the widget object by string name? eval('$(myTabSpace).' + widgetNane + '({options})');
getting error "permission denied" in IE 7 and IE8
hello, ihave problem in IE 7 and IE 8. here is my code. iframes=document.getElementsByTagName("iframe"); for(var frame=0;frame<iframes.length;frame++) { var iframedoc=iframes[frame].contentDocument || iframes[frame].contentWindow.document; if(iframedoc) { objects=iframedoc.getElementsByTagName("select"); for(var index=0;index<objects.length;index++) { objects[index].style.visibility="hidden";
Accessing variables outside of function?
Ugghh - I don't know what I'm doing wrong - probably pertains more to Javascript than jQuery. $(document).ready(function(){ var myVar = 0; $("#myButton").click(function(event){ myVar++; }); $("#myButton2").click(function(event){ alert(myVar); //this returns 'undefined' Why? :( }); }); Why can't I access the 'myVar' variable my clicking 'myButton2' ??
Keyup Changing the url of the browser
How would i make it so basically everytime you keyup it would post that data in the url without refreshing so when a user clicks on a link they searched for and go back it will have whatever they typed last in the search bar?
Get the id of the current selector element
Hello, I need to get the attribute id of the current element which comes from a selector. As I found out with the help of this forum I need to use $(this).attr("id"). Unfortunately this just returns "undefinied" for me. Does anybody have an idea why this doesn't work? This is my complete code: $(".element").editInPlace({ url: ('/elements/' + $(this).attr("id")) });
SCRIPT ERROR - PLEASE HELP!!!
IE Reporting null values from the line below, please advise! function parseXml(xml) { //$("div.totalprice").text($(xml).find('PriceTotal TotalPrice').text()); jQuery ("div.totalprice").html(xml); SubmitPlus('PRICE'); }; function SubmitPlus(pType) { var lSailingFld = document.getElementById(pType + '_PLUS'); var lImgFld = document.getElementById(pType + '_PLUSIMAGE'); if (lSailingFld.style.display == 'none') { 'THIS LINE IS CAUSING THE PROBLEM
Prevent tab text highlight / disable tab text selection
Hi, Here's a sample form: <form action="#" method="post"> Name:<br /> <input type="text" name="name" value="your name" /><br /> E-mail:<br /> <input type="text" name="mail" value="your email" /><br /> <input type="submit" value="Send"> </form> When you tab to a text input, the value gets highlighted. How can it be disabled? Any help is appreciated! Mike
what the heck am i doing wrong?
i can't get the following code to work. it works fine if i use the commented out line: $("#quote p").load("dbtester.asp?payor=CHECK+TESTER"); so i guess i must be formatting something wrong? thanks in advance <html> <head> <title>AJAX with jQuery Example</title> <script src="scripts/jquery-1.5.js"></script> <style type="text/css"> #wrapper { width: 240px; height: 80px; margin: auto; padding: 10px; margin-top: 10px; border: 1px solid black; text-align: center; }
Multiple $.get from id.ready
the jquery section: $('tr[id^="emp_"]').ready(function() { var emp_ID = this.id; var ID = emp_ID.replace("emp_", ""); var url = '/inc/DEV_schedule.asp?ID='+ID+'&S_Date='+4/1/2011+'&E_Date='+4/30/2011+''; var loadID = emp_ID.replace("emp_", "load var sched_ID = emp_ID.replace("emp_", "sched_"); alert(ID); /* $.get('/inc/DEV_schedule.asp?ID='+ID+'&S_Date='+4/1/2011+'&E_Date='+4/30/2011+'', function(data) { $('tr#'+emp_ID).html(data); }); */ }); The html section: <div class="employees"> <tr id="emp_69">
Pull from hidden div or http request?
i have a page which loads content into a div from a hidden div. There are about 8 hidden divs all loaded with content loaded. Then when the user clicks a link the visible div is loaded with the content from one of them. Is this the best way? or should i be loading the content from another script via $.get()? i use the same thing on my PM system which loads 10 hidden divs. So should i really be using $.get() for this aswell?
change event not firing on select
In IE only, the change event on a select does not seem to fire if the change is made by typing on the keyboard instead of clicking with the mouse. However, when the focus leaves the field, the event fires. Is there any workaround for this? Thanks!
Hide <div> with jQuery
Hi, I want to hide a div box when the user go with his mouse over a button. I have no experience with jQuery, so maybe you know a already written script for that. Thanks! David Lampe (Using Wordpress)
using .animate() - question regarding fluent animation
I have been reading the .animate() function and it is pretty much what I need, but the only problem is that, for example, the following code animates the div (which is what I want) but when the animation starts it starts slowly, then goes faster and then ends slowly again. I need it to be a fluent movement, always at the same speed (for example moving a div 50px to the left in 500 ms). I read something about using "easing: linear" in the options, but it didn't work. I also read on the API examples
Return to default value
Hi: I have this simple code for change combos based on selection. $("#manufacturer_id").change(function(){ $.ajax({ url: 'index.php?route=catalog/product/getConsignaManufacturer&token=<?php echo $token; ?>&manufacturer_id=' + $('#manufacturer_id').val(), type: 'GET', dataType: 'json', success: function(data) { $.each(data, function(){ $("#consigna_id").empty().removeAttr("disabled").append('<option value="'+this.consigna_id+'">'
Resizable select box, size attribute value updated on resize event
I'd like to make a select box that is resizable (using the 'resizable' script) and also modifies the native HTML select's "size" attribute. When a select's size attribute has a value of "1" (or no value at all) it displays a button on the right of the box (the down arrow); clicking that button causes the option list to overlay the page. If the size attribute have a value of greater than 1, the select does not show the button; instead it behaves as a multi-select box (without allowing multiple selection)
Expand and Hide a section
Hello, I created a Expand/Hide toggle for my About Me section. I used the following codes below. How do I make it to default the About Me section to Hide first instead of Expand? Attached is an example. Attached is all the codes for the page. <div class="app-box" id="about-me"> <div class="app-box-menu toggle"> <a class="app-box-menu-icon" href="javascript: void(0)" onclick="joms.apps.toggle('#about-me');"></a> </div>
remove() not chaining
I've discovered, that remove() function can't be chained, as it runs before other functions in chain.Is it done on purpose? I believe that calling remove() as a callback, is much more clumsy, than chaining it. Am I wrong?
problem with jquery-1.5.2.min.js and JSF rich:modalPanel
Hello, I'm developing an application using Jboss Seam ( JSF, richfaces ...) i have a page that i integrate Jquery to add drag and drop flexibility...I'm facing a problem with rich:modalPanel; when i add jQuery to my xhtml ( <a4j:loadScript src="/scripts/jquery-1.5.2. min.js" /> ) ; i can't render the rich:modalPanel (popup) ; it seems that it is a conflit between Jquery and loading rich:modalPanel...can someone have an idea to this problem ?
i want to get height of page, when page maximize or minimize.
i want to get height of page, when page maximize or minimize.
JQuery code is not working on web pages.
Hi All, I am new to JQuery. I have created an web based application on ASP.net in VS2010. In this, there is a master page Site.Master and that master page is applied to all pages in that application. In default.aspx, I have written code using Jquery is: $(document).ready(function () { $("#accordion").accordion(); }); This code does not work on default.aspx. When I moved this code to Site.Master is start working. Can someone please resolve my this problem? We can not write all code
[jQuery] [datepicker] unique id for datepicker (ui-datepicker-div)
hello, Is it possible to assign some unique id-s when using multiple instances of a datepicker (DP) on a page? currently i'm tinkering with this timepicker (TP) ( http://milesich.com/timepicker/ ) because i desperately need a TP, but without DP. so far i managed to make only the TP appear, however, this TP is bound to the DP id (ui-datepicker-div ) so in a page where i have 2 DPs and 1 TP, the TP shows correctly, but the DP do not show. Thanks, Dan
Is this effect with jQuery? If so How do I do it?
Is this effect with jQuery? If so How do I do it? When you run the mouse pointer over the menu items a transparent image pops up and slides in from the right. How can I do this? Where can I get the code for it? Here is the site: http://www.valentino.com Peter
Warn if form was not changed
Hi, I want to warn the user, if he modified a form, but leaves (e.g. clicks on a link) without saving. On the net I found this: http://misterdai.wordpress.com/2010/06/04/jquery-form-changed-warning/ Is this the way to go, or is there a better way? Thomas
Disabling one JQuery if another one is used
Hi, To begin, I'm a novice at this. I'm using 2 JQuerys on a page - $(document).ready(function() { $("body").css("display", "none"); $("body").fadeIn(2000); $("a").click(function(event){ event.preventDefault(); linkLocation = this.href; $("body").fadeOut(1000, redirectPage); }); function redirectPage() { window.location = linkLocation; } }); </script> <script type="text/javascript"> $(document).ready(function() { function filterPath(string)
POSTs not transmitted
Hello, I have problems with a jQuery script. At the beginning, the script displays 2 forms. When we click or write in one of the forms, then: - it adds a new line only if the clicked one was the last line, - it POST forms data of the line into a PHP file. But my PHP file does not receive any POST. $_POST result is :Array () Here are my complete HTML file (1) and PHP file (2): <script type="text/javascript" src="js/jquery.js"> <script src="js/jquery.min.js"></script> <table id="tab"></table> <script>
Right Pane Vertical Menu -> Left Pane Images Mouse over menu
Hi All, I'm looking for a menu that has tabs in the right side placed vertically and in the left side there will be images showing accordingly which menu item is mouse hovered. Please advice, Thanks
$.post returns data but does not display it
Hi guys, I need help with my $.post, it calls a php file which retrieves data from my database and should return a JSON datatype result. I checked on firebug, and it does successfully retrieve the data in JSON format. I however cannot get it to display on screen. I want to populate input fields with the result accordingly. Here's a chunk of my javascript: (this function is being triggered by a dropdown) function updateBillingAddFields(address_book_id) { jQuery.post("ajax_checkout_confirmation.php",
How to submit a handler to an HTML button to a function bound to it via the jQuery bind-function
Dear all, this is embarrassing - but I can't figure out how to do it: what I want to achieve is to design an elegant way to test a larger JavaScript code... for that purpose, I want to find a way to test several of my methods (and their results to different inputs). My idea is to create a simple document, in which several HTML buttons can be clicked by a user, and then each time on click call the same JavaScript function and submit an input to it (which needs to be defined in an intelligent way -
jquery tabs - how to disable ajax
I have rolled my own ajax call triggered to the select event since I need to return some form post data with the ajax call. How do I disable the standard ajax call within the tabs module? I don't want to be making unnecessary roundtrips to the server.
Liberate memory of DOM ! Need Help ! Please...
Hello everybody ! Sorry for my English... I'm French... I've a big question ! I'm working with my iPhone, but my question is jquery and not jquery mobile so : I've a structure of page : <div id='art'> <video id="vid"....></video> </div> To empty my div, I make $('#art').html(''); But when I test : var movie=document.getElementById('vid'); $('#art').html(''); alert(movie); I have an object [html Video].... and not null... So it's in my dom and in my memory... so : my method is bad ? How
How to monitor any HTML element for a change - in either it's inner HTML or CSS...
.change() is only for form elements minus check boxes/radio buttons, etc... Are any of you aware of a script that does this already? Hopefully one that is easy to implement... I just want to monitor things like height, number of inner elements, or any change in the inner HTML... thanks, j
How to do this effect (fadeIn?) without plugins
I have a div (background red) and I'd like to shade it to black, such as fadeIn() function from red to white, instead of display:none; to the color. Is it possible do it without plugins?
jQuery pm system
i have made a small pm system with jQuery for my site. When the page loads i would like the content of the first pm to be loaded into the div on the right. the div on the left holds the subject name and sender of the pm. All the pm divs in the left pane have ids beginning with message- and are followed by their id in the database: <div id="message-109"> the message content is housed inside a hidden div with the same id type <div id="content-109"> then when a message is clicked this div is simply
Can't select "dynamically" created element by id
Hi all. I'm confused by some jquery behavior. I've scoured google for an explanation, but I don't get it. I'm creating some rows and cells in a table with javascript. I'm then trying to select these cells individually by id, but jquery can't seem to find them. It always returns length 0. The jquery code is, I believe, executing after the cell creation, so I would expect them to be in the DOM already. I can bind the click event to each cell by selecting the cell's class. Why can I select the class,
How should I make a div change image when changing the page in drupal?
I have next url for you to look at www.jellev.com/bloem/ and i want the blue bar to contain an other image for 'some' pages... the action should be performed on the click of the menu items of my drupal site. I was thinking that this would be easy with jQuery but the problem is that jQuery is a clientside action and when the link is clicked its a server side request response and the image should stay the same... is this a little clear ...? It's a very complex explanation for a simple problem i think.
Check each Property of an Object
Hello, i am locking for something to get all Propertie`s of an Object (with an each loop?) <div id="blub" class="blah" name="blah"></div> <script> $('div').attr(function(){ //somethink like that. Know that its wrong $.each(this) }) </script>
attaching events to dynamically added elements
I have a form where the user can add new fields by clicking 'add another item' button. Each new field has a 'remove' button attached to they can remove that field if they don't need it. the remove buttons all have the same class: 'removeItem'. Then, in my jQuery I have the following: $(".removeItem".click(function(event){ $(this).parent().remove(); }); The only element that this woks on is the original element in the source, but not any of the dynamically created elements which basically look
Script to make Table Cells equal height of the tallest cell - Per Row, but it is making all cells the height of the tallest cell on the page!
jQuery version: jQuery 1.5.2 Problem Description: I am using the following HTML to show 6 categories on a page, each category has a different size list of items beneath the cell heading... I want to make the height of all cells PER ROW to be equal. My script currently is making ALL cells on the entire page the height of the largest cell. How can I make it only apply the highest height per row? jQuery Script: var divheight = 0; $(".lRow").each(function(){ $(".nexTextblock").each(function(){
Next Page