JQuery :: Getting Incorrect Returned Results?
Aug 24, 2009
I am pulling in an XML doc, storing it in a global var and through out the app I am transversing it to grab certain info. Up till 1.2.6 it's been working fine, but when I upgraded 1.3.2 I get bad results.
Here are my two test pages:
[URL]
My guess is the it has something to do with Sizzle but I can't place exactly where the issue may be happening.
View 1 Replies
ADVERTISEMENT
Sep 27, 2006
I noticed weird results when using eval() to do some simple calculations. Here are a few eval() statements and the corresponding results from javascript:
eval("1.2+0.97") =2.17
eval("1.2+0.98") =2.1799999999999997
eval("1.2+0.99") =2.19
eval("1.2+0.981") =2.181
This can happen with other numbers as well, but certainly not with any combination. I have confirmed this on Firefox and Safari, two different versions of OS X and both Intel and PowerPC Macs.
View 4 Replies
View Related
May 4, 2010
I have a html form which produces 3 post varaibles.
I'd link to be able to call a php file when sumbitted that sends the data from my form and returns the results from my php file to a div on the oringal page.
I know that you can use .load to call a page to be diaplayed within a div $('#container').load('url #div_on_page') but dont know how to send the from data.
this is the code.
<form method="post" id="new_user_form" >
<input type="text" name="newuser" />
<br /><br />
<input type="password" name="newpassword1" />
[Code].....
View 5 Replies
View Related
Jan 9, 2009
I have a <div> tag that contains a table of results returned using AJAX. I have an onmouseover on the div so that when the user is viewing the results the div stays visible. An onmouseout is also declared so that when the user goes off of the div, it will disappear after a few seconds. When the user clicks on an entry I perform some logic and close the div.
However the problem occurs when my AJAX returns too many results to display in the set size of my div. When this occurs my div becomes scrollable. When the user is interacting with the scrollable, it seems to fire the onmouseout event because the div disappears.
View 2 Replies
View Related
Jul 25, 2011
I am doing a few tests with javascript and oop. but one failed so i falled back to the way i usually do this but it still isnt working properly. i am using $.post() but instead of returning whatever is echoed in the php file like it does with all my other scripts it returns the content of the file:
Isnt returned in var data but the whole file is returned as a string.
View 1 Replies
View Related
Apr 21, 2010
I'm just getting into jquery and was testing to see how I could handle php/mysql errors on my ajax function page. I thought that if I set the datatype to xml and since the error page was html it would throw an error but it doesn't. How can I handle this?
View 5 Replies
View Related
Oct 19, 2010
However, I finally ran into a problem that I can't figure out. When I try and get the width of any cell in a table it's returning a width of 83 or 84. I have the table inside a div that has a width of 757px. I don't have a width set on the table itself, but each cell is set to 100px. I've tried to set the width in a css file and inline neither of which give me the 100px that I'm thinking it should return. I've tried both width(), outerWidth() and innerWidth(). The only one that returns a different number is outerWidth.
View 6 Replies
View Related
Oct 11, 2011
i am using this script
Code:
<script type="text/javascript">
$(document).ready(function() {
for ($i=0; $i<4; $i++) {
var num = $('.clonedInput').length;
var newNum = new Number(num + 1);
[Code]...
all works well, less one thing. The id names of valores are incorrect in the last loop.
[Code]....
View 2 Replies
View Related
Aug 5, 2011
Im working on some drag and drop logic similar to the jQuery shopping cart example, but I've run into a small hitch. If I double click on the LI within my 'dropped' area it causes them to become draggable again. I specifically set up drag to only work from one source list, so Im unsure how double clicking is causing this bug?
View 1 Replies
View Related
Apr 18, 2010
I think the offset() function returns node's position relative to document. The attached html file prints the offset value to console when the box is clicked. I expect the same value would be printed every times. However, when the script is run on iPad (with simulator), it print different value when I zoom and scroll to different position. This problem does not occurred in iPhone.
Attachments
test.html.gz
Size : 388 Bytes
Download : 505
View 9 Replies
View Related
May 28, 2010
jquery width() and height() functions are consistently returning the wrong values for the viewport size (i.e. $(window).width). Anyone know why..or what I can do to fix it?
View 3 Replies
View Related
Dec 13, 2007
I'm using height() and width() to find the dimensions of some inline images in the html. FF and IE work fine, but Opera is returning incorrect values. For example, it returns 92px as the width of an image that is actually 160px wide. How can I fix this?
View 4 Replies
View Related
Oct 30, 2009
I'm developing a chess game recorder (records chess games just like electronic score sheet) and i am trying to write a function that handles the "en passent" rule in chess. However, when i try to test to see if a Black pawn is at a particular x,y location, it is always giving me back "50px". Even when it's not at that location. i uploaded semi-live version to my website here: [URL] you just click on the 'Play' button to start the game here's the function in question:
[Code]..
View 4 Replies
View Related
Dec 22, 2011
I have a global variable that I change depending on what's going on in screen.
And that function changes that variable.
For some reason, in FF, it modifies the variable as expected. But in Chrome, it doesn't.
Why is this? Is there any way to have consistent behaviour in both browsers?
In fact:
Returns true in FF, but false in Chrome...
View 4 Replies
View Related
Oct 4, 2010
Does anyone know of a place to get a code that looks at what is typed in a textbox and displays a green checkmark or a red x next to the textbox if the value entered is invalid. Eg. if no @ is entered in the email field, a red x would be shown next to the email field. Eg. if a zip code contains letters, a red x would be shown next to the zip code field. Eg. if the email field contains a @ and a period, a green check would be shown next to the email field. Etc. The green check or red x would have to be shown either as the user is typing or after they go to the next field (Blur).
View 1 Replies
View Related
Apr 10, 2009
I should imagine others here have experienced it. The user completes your form, and they unintentionally input their email address incorrectly. Then when you reply to their form, you then get the mailer daemon returning your email! Now, there's a couple of ways that some websites try to solve this problem - some ask the user to input their email address twice, some show the forms results on the next page, so that the user has a last chance to check, before completing the submission. Are there any other ways of trying to ensure that, as much as possible, that the user inputs the correct email address?
View 10 Replies
View Related
May 7, 2010
I am FAR FROM BEING KNOWLEDGEABLE about javascript. On my web page, I want to have a slideshow run that'll show small-ish versions of images. I don't want the whole thing re-displaying every time, so I put together a little javascript to figure out how to show the images.....
I have one ALERT in here to show me the dimensions of the window and the image, and I'm getting one or more values coming up as "0"...... Which means that image doesn't display. The image(s) are NOT zero width or height, and neither is the window..
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
[Code].....
View 5 Replies
View Related
Oct 31, 2011
I have the following few snippets of code:
JS:
Code:
$(function() {
$('.delCatButton').live('click', function(e) {
e.preventDefault();
var cat_name = this.title;
var delCatFormID = $("#delCatFormID").val();
[Code]...
The $_SESSION['delCatFormID'] variable in the process.php page is incorrect, and never equals the posted variable.
View 3 Replies
View Related
Apr 28, 2011
I have a list of links to PDF articles, each link has a corresponding div that contains an introduction to the article. I'm using the onmouseover event in each link to show the corresponding introduction div and hide all the others.
The order and number of the pdf links and the introductory divs are the same. The code below works in IE but not in FireFox - the problem in FF is the index returned from the onmouseover event is double what it should be, so the first PDF link shows the second div, the second PDF link shows the fourth div ect.
javascript:
Code:
css:
HTML Code:
html:
HTML Code:
View 7 Replies
View Related
Jul 19, 2011
Here is the code I am running:
The url is a very straightforward servlet that queries a database and returns either Y or N. That part is working fine. The first alert shows Y or N just as it is supposed to.
However, the second alert is always showing Turbo, as though the if statement is not able to compare properly. This is probably javascript rather than specific to jQuery, but can anyone see where I'm going wrong?
View 4 Replies
View Related
Apr 4, 2011
Every parse example I have seen on the internet is the well formed;
jQuery.parseJSON( ' {"sid":"123455","client_id":"1","last_name":"Anderson","first_name":"Alan","institution_id":"1"} ');
What is the easy way to get from this;
{"posts":[{"post":
[Code]...
View 5 Replies
View Related
Sep 7, 2011
So just found out the problem I was having, and came up with a solution (bandaid really) but would like to know if anyone else has run into this and what they did.
Code JavaScript:
var left_margin = $(this).css('margin-left').replace(/D/g,'');
So the above, get the left margin of the object, strip all but numbers and store into a variable. Easy, right? Here's what happened. Inserted the object into the DOM, Chrome returned 212px, which was converted to 212�*fine. Firefox on the other hand returned 212.5px, which was converted to 2125� not fine. I'm centering the element on the screen based on this number, so the additional 2000ish pixels is WAY off. My solution was to increase one of my initial values a single pixel in which both browsers return 213px�*but like I said this is only a bandaid solution. Not really understanding the value of .5 pixel, but looking into that. Is there a rounding function in jquery? Javascript I would have to strip the px from the string, convert to integer and THEN round.
View 3 Replies
View Related
Apr 7, 2010
I am using this code in c#. I need to create a url dynamically which the following code does. The BuildURL method has a string return and returns the build URL. How do I get that value and use it in the following code?
$("#myButton").bind('click', function() {
$.ajax({
type: "POST",
[code]....
View 4 Replies
View Related
Feb 2, 2011
I have a script that post some values to a php file and on it if i echo or return anything i cant get the value,
the alert is always empty
$.post("file.php",{x}, function(data){
alert(data);}
php file
echo 'test';
also tried with return but also get an empty alert
View 4 Replies
View Related
Aug 5, 2009
i am doing an application which make use of JQuery and Cakephp . In this i am using like the following to retrieve the values from my controller side
var getformid;
$.getJSON("http://localhost/FormBuilder/index.php/forms/getFormEntry", function(json) {
getformid=json.forms[0]["id"];
[code]....
In the above code, the inner alert that is inside $.getJSON gives me the correct value as 75 But the outer alert showing me the error as getformid not defined..Why so??Can't we make use of the getformid available outside $.getJSON .Please suggest me.SInce i want to make use of that value for saving the Field ..
View 2 Replies
View Related
Jul 8, 2010
$.ajax({
So I'm loading the div#my_events by prepend(data) where "data" is another well styled div. Is there anyway to animate this returned data. Unfortunately I can't just specify a unique ID on the incoming data. So I was wondering how else I might be able to address this data I'm returning.
It is basically a topic list, with a modal that sends jquery to add a topic to the database, and returns the topic from the database, hides the modal, and displays the last added topic at the top of the topic list. Now I'd like it to do something slightly fancy like animate the color of the background to bring the user's attention to it.
View 1 Replies
View Related