JQuery :: Load Function Works Once Only
Mar 6, 2011
I've got this code to work the first time that the user changes the select option:
$('select.third, select.fourth').change(function(event){
var id = $(this).siblings('.hidden').text(),
token = $('#token').val();
param = $(this).hasClass('third') ? 'isSold' : 'isActive';
value = $(this).val();
$('div#allSheepDisplay').contents().remove().end().load(
'db-interaction/animals.php',{
action: 'update',
id: id,
token: token,
param: param,
value: value
}, function() {
$('select.third').filter(function(){return $(this).val() == '1'; }).css({backgroundColor: 'yellow'});
$('select.fourth').filter(function(){return $(this).val() == '0'; }).css({backgroundColor: 'red'});
}); });
Everything works as I expect - the POST request is made correctly, the database is updated and the display updates correctly. However, if I repeat the same action, selecting a different value, nothing happens until I refresh the page, at which time I can then make the change.
View 6 Replies
ADVERTISEMENT
Jul 18, 2011
im trying to make a application, im trying to comunicate with the server with the function load, but it doesnt work, also i try with $.ajax, $.get, but nothing works, i have 3 files, html file, php file and javascript with jquery file,here are the php and javascript files:
javascript:
var x;
x=$(document);
[code]....
View 2 Replies
View Related
Dec 10, 2010
It concerns the load() method. I planned my website as 100% ajax enabled and therefore all content-elements are being loaded via jquery.Problem: Clicking on a menu-entry should load the specified content. This works 2 or 3 times and then the website crashes OR the performance goes rapidly down and I have to close the tab in my web-browser.Trigger for the load method (tried both, but they are causing the same problem)
$('#menu_home').click(function(){ loadSite('home'); });
$('#menu_home').live('click', function(){ loadSite('home'); });
Self-designed load() function:
// load links from menu
function loadSite(siteId){
// append loading animation
[code]....
View 7 Replies
View Related
Apr 27, 2010
I've been trying to load some tags using .load. I was testing with Chrome and never got any results back - I just tried the same code with Firefox and it works - where's the problem ? Am I doing something "almost" correct, that firefox allows and chrome doesn't? I cannot see any errors in the console either
Here's the line:
$("#somediv").load("somepage.html #someotherdiv");
View 2 Replies
View Related
May 29, 2011
I am using $('.CycleContents').cycle which works quite fine in all browsers but if i load the contents before cycle by using load functionit works in firefox but in IE i need to refresh and then it works and doesn't work very first time.
[Code]
View 2 Replies
View Related
Aug 31, 2010
with the folowing code i load over the funktion golabel the content in a div.so fare it works in IE fine. why does it nork in firefox?
function golabel(url,label,hoehe) {
if (movieIsLoaded(thisMovie(movieName))) {
thisMovie(movieName).TGotoLabel("_level0/",label);
[code]....
View 4 Replies
View Related
Apr 15, 2011
I'm developing a listing of workers, where the user can by department select through of tag select (html). But, my jQuery function not works in IE 8.
[Code]...
View 6 Replies
View Related
Jan 12, 2010
I have an error and I don't know how to solve it. Well I load a page into a div called 'entry_container'for my WP theme and I use this function:
[Code]...
View 12 Replies
View Related
May 3, 2011
I've noticed very strange .load behavior. So - I have simple index page like this:
U can check it here: [url]
View 12 Replies
View Related
Aug 25, 2009
We're attempting to load a snippet of XHTML into a container on a page via .load() from a fancyBox pop-up.
Here's the bit of jQuery we're using:
[Code]...
View 7 Replies
View Related
Oct 26, 2010
Friend of mine made this script and it works fine inFF (check url beneath) but it wont load the same way in IE. Well it wont load at all there. Can anyone see the problem right away? Im very new to this and iv'e been looking everywhere to try a find a fix for IE solving my problem, so you are kind of my last hope. My friend couldnt find a fix for it either but we assume the code is good as FF does what its supposed to do.
You can test it here [url]
View 4 Replies
View Related
May 29, 2011
This script working great on FireFox and Chrome but on IE it loads the pages without sending the parameters
[Code]....
View 3 Replies
View Related
Feb 15, 2011
I have the following code to load some pages into a div using the load function. When I click one of the links though, nothing happens. I have read a couple of books on JQuery and looking at the examples they give, this looks correct so I am at a loss.
[Code]...
View 4 Replies
View Related
Nov 14, 2011
Can the .load() function load .php pages? example: $('#element').load('mynews.php');
View 3 Replies
View Related
Jul 7, 2011
I used DrDOS's solution from [URL]and modyfied it a bit so I have 2 images, first without and 2nd with a link to other page. It works just fine in FF but in Chrome and in IE it shows just 2nd image. On place where first image shall be it's just blank white space. I have javascript enabled in all browsers, btw.Here's a code in head:
<script type="text/javascript">
function loadImg()
{
[code]....
View 4 Replies
View Related
Jul 1, 2010
I'm using the Google AJAX APIs, but some reason google.load works when run through normal javascript, but if I call the method from my jquery ready function it doesn't work. Code and output is below
page.html
<script type="text/javascript">
loadGoogleStuff();
function loaded() {
console.debug("in loaded function");
}
[Code]...
window.loadFirebugConsole is not a function If I comment out line 3 in code.js, the console debug runs okay, so the ready function is running okay. Even though there's a reference to Firebug, the same error occurs in Safari too. Nothing on the page loads.
View 1 Replies
View Related
May 10, 2010
I am not really sure where to start with this as my function works perfect in IE 6. However when I select one of my categories and hit submit in Firefox or IE7 or 8 nothing happens. No error message. Just nothing. How can I get this working for firefox and IE7/8?
[CODE]
<script language="JavaScript">
var categories=[];
var categorieslist=[];
[Code].....
View 2 Replies
View Related
Jul 4, 2011
Basically, what I'm trying to do is set the left margin of an image based on the width of the image, because I want the image to appear centered relative to the link table above. I've been using this code:
function insertImageMargin(){
var marg = getImageMargin();
document.getElementById("comic").style.marginLeft = marg + "px";
} function getImageMargin(){
var com = document.getElementById("comic");
return 440 - com.width / 2;
}
What happens is, the first time com.width is 0, but if I hit reload, it is the width of the image, and the code works correctly. How do I get this to work the first time.
View 5 Replies
View Related
Jan 17, 2011
I have what I think is a strange issue but others may see something I am missing.I am using AJAX functionality to process a php script on a server and then place the output of the script into a div element.Here is the code snippet
Code:
function doWork13(typeCode,colorBlockName,objectCategory,imgID){
httpObject = getHTTPObject();
if (httpObject != null) {[code]....
This code shown here works perfectly BUT....I do not want the alert message to be there. When I remove that line of code the script fails to function. There is no error just nothing happens.The function is to replace one image with another and the variable in question is simply the ID tag of the particular image being modified.As I said it works with the alert but does not with out, could it be a timing issue in that the alert gives enough time for the if statement in the setOutput13 function become TRUE
View 6 Replies
View Related
Jul 16, 2009
I'm having an annoying issue with addClass(). I'm trying to find all divs with id name '#moldura_slides' and add the class '.horizontal' to each one of them. The problem is that only the first div matched gets the class. The others are just ignored and don't get it.
$(document).ready(function(){
$("#moldura_slides").addClass("horizontal");
});
This is the page: [URL]
View 3 Replies
View Related
Dec 2, 2010
I've got following function:
[Code]....
I would like to run this in recursive mode, and I'm starting the function with:
$(function(){
$.bubbles();
}
The problem is, that function works only one (and a half) time. Console shows: start callback start I have not idea what is a problem. Function needs to be run constantly.
View 2 Replies
View Related
Aug 30, 2011
I'm working on dynamic list with jQuery. I've appended hundreds of <li> elements with for loop to make very long list. When user scroll down again, remove older ones and append new ones at last of the list. I used$('li:lt(50)').remove() to remove first 5 elements from the list. At first, it works. But, for the second time, it always delete half of '50'. When I enter 100, only 50 elements deleted. How can it be? Could you check the ':lt(n)' selector and remove function? My HTML is very simple. only <UL> <LI> tags in the body. Tested on latest Chrome(ver.13.0.782), jQuery 1.6.2.
View 1 Replies
View Related
Sep 3, 2010
I've got the below function that works perfectly fine in FF, but it acts like nothing is happening in IE 8. I've tried the no cache option, my own url random addition and numerous variations.
View 2 Replies
View Related
Oct 7, 2010
I'm trying to submit a form with the jQuery Form Plugin by malsup. I'm fairly positive my code is correct because in IE8 the success function is being called and the background of the boxes are turning green. In IE7 however, The submit function is definitely working as the file is uploaded to the correct place, but the success function is not being called/fired. Any ideas as to why this might be? Do IE7 and IE8 handle this that differently? The function in the success call is just changing a checkbox and combo box background colors to green.
View 1 Replies
View Related
Sep 19, 2009
I have a simple form that inserts a name into a database. The functionality works fine. But the message that is suppose to show is wrong.
Code JavaScript:
$(document).ready(function () {
$('#nameForm').submit(function () {
$('.msgbox').hide();
$.post('ajax.Register.php', {name: $('#name').val()}, function (data) {
if (data) {
$('.msgbox').show('fast', function () {
$(this).html('OK!');
});
}else {
$('.msgbox').show('fast', function () {
$(this).html('Failed!');
});
}});
return false;
});
});
The form always shows "Failed!" even though the name went through in my database.
Code PHP:
try {
$objUser = new PDO("mysql:dbname=ajax;host=localhost", "root", "");
}
catch (PDOException $e) {
echo 'Unable to connect';
}
$strName = $_POST['name'];
if (empty($strName))
return false;
$strQuery = "INSERT INTO name (name) VALUES (:name)";
$objStatement = $objUser->prepare($strQuery);
$objStatement->bindParam(':name', $strName, PDO::PARAM_STR);
if ($objStatement->execute())
return true;
return false;
View 5 Replies
View Related
May 25, 2009
[URL]Example on this site u can test what i mean. I want that when all skillpoints are used further click function is disabled or better only works to disable selection to gain again a skillpoint. On current state u can see that when skill counter is at 0, 2 clicks messes up the selection and u can select further on. my code for each icon looks so far like this:
$("#2").toggle(
function () {
if (counter > 0) {
$("#3").attr("disabled", false).fadeTo("fast", 0.50);
[Code].....
View 1 Replies
View Related