Reloading DIVs with updated database data
I just started learning JQuery/AJAX today, so sorry if this is a very stupid/obvious question. Basically, I have two DIVs that display some data stored in a MySQL database. One DIV shows some items, and clicking on one changes that item's status to "active" in the database. The other DIV displays the current "active" item. Here's how I've tried to set it up: This is how each of the items are displayed in the first DIV (id #itempanel): <img src="'.$row['item'].'.gif" alt="" onclick="update('.$row['id'].')">
toggle slide open hidden div and slide close open divs at same time
Trying to learn the basics... Here is a script for three toggle buttons that each when clicked open their corresponding divs. Fine. Now how does one go about automatically closing an open div when clicking on a new 'toggler' that opens it's div? I see other posts about this very question, but I'm just not grasping the logic. jQuery(document).ready(function($) { $("#toggle1").click(function () { $("#toggle1div").toggle("drop", {direction:"right"}, 500); }); $("#toggle2").click(function
jquery not working, $ is not defined
I included a local jquery.js file but for whatever reason it just doesn't work http://drfool.net/testt/test.html there's my site with the live example. I know jquery is not working because alert($(document)) returns an error ('$ is not defined') Any help would be much appreciated, thank you.
problem with show hide toggle and .next()
I've got the following working on a menu where I have links: a class="show" followed by div class="showme" it works toggling all divs at once but when I try to use next() I get nothing - I can't see what could be wrong: (the //commented out bit is the next() attempt which doesn't work) <script type="text/javascript"> jQuery(document).ready(function() { jQuery("a.show").click(function(){ jQuery(".showme").slideToggle(500); // jQuery(this).next(".showme").slideToggle(500); return false;
update div or td
hi, how can i update only inside div using GET? <a href="update.php">Update text</a> <div id="#myid">Old text</div> after i click the link i recieve new text form update.php and i would like to replace the text inside this div?
Problem with IE using Superfish Menu
Hi. Im using The Superfish Menu code(http://users.tpg.com.au/j_birch/plugins/superfish/#examples) in a web page and it works in all the browsers except Internet Explorer 8, because it says: to help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer. Somebody has any idea to solve this problem in the code. Because i need the web page to work properly in IE. Thanks
Submit form when validated.
Hi there! I have this create user form, and I'm checking if the email hasn't been used already. This works... But what my problem is, that if the email has not been used before, it will not send the form, while I return true. I've tried to use $(this).submit, but that will just make it loop and never stop. So basically: if data.is_dublicate = true show error else data.is_dublicate = false submit the form Anyone who can help me out? $("#add_user").submit( function(){ var error = $('#dublicate');
Setting up multiple toggles on one page
Am I missing something here? I want to be able to have more than just one button to toggle the drop function with different content. I'm using the test code below to set this up. Works fine if just using "btn" and "btndiv" but nothing happens when I add "btn2" and "btn2div": <!DOCTYPE html> <html> <head> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
Suggestions for implementation
Hello To start off, I am pretty new to jQuery but I think I'm getting hang of it. Anyways, to the question. I'm doing an app in Adobe AIR. It uses html and jQuery so it's basically a webpage. It's a simple app, here's how it will work. You get a small notifier (like if someone has logged in on MSN) with a math problem. For the sake of simplicity the problem is " 5 + 5 ". This appears in a paragraph tag in a div with the id "Problem". The user then inputs his guess in an <input> with the value text
Menu Fade
Hello all, noob here. I have a menu that I need to dropdown and fade in on mouseover. I am lost on getting everything to tie in to the CSS, at least I think that's the problem. The other problem is having a lot of "white" space at the bottom of the page, I assume I'm not using display or visibility correctly. Here is the code (my apologies for the length), any help would be appreciated! Thanks in advance! $(document).ready(function() { $(".aboutus").mouseover(function(e) {
how to select which doesn't has an input child
I try to use .not(children('input')) to select which doesn't has an input child, but it doesn't work. <!DOCTYPE html> <html> <head> <script src="js/jquery-1.4.2.min.js"></script> </head> <body> <table width="100%" border="1"> <thead> <tr> <td> <input type="checkbox" id="chk_del"> </td> <td colspan="2"> </td> </tr> </thead> <tbody> <tr> <td> <input type="checkbox" id="del[]" value="del1"> </td> <td>alert</td> <td>alert </td> </tr> <tr> <td> <input type="checkbox" id="del[]" value="del2"> </td> <td>alert
Offline Application
Greetings! I am brand new to jQuery and I'm trying to determine if it will be a good choice for an application that I need to develop. The application will need to use a xml file as it's data source and update it with an html form. The tricky part is the application will need to function "offline" at times. Here is my scenario: User connects to our website and downloads an XML file filled with data onto a portable computer. User then goes to a remote location to perform an inspection with no
FAQ If Statement Problem
hello, I have a simple FAQ show/hide function set up however i am having troubel setting up an if clause. my code is; $(document).ready(function(){ $("dd").hide(); $("dt").click(function(){ $("dd").hide('slow'); $(this).next().slideToggle(); }); }); However, when you click on the same item twice it fistly hides and then reshows it, i need an if statement that basically states; if "this?!" is visible/shown
turning a dom element into a select whatsit
Hi, I am picking up a drop event and am trying to manipulate the drop target. event.target gives me the actual dom element but I want to call .addClass(...) which you do on the results of a selector. How do I convert the dom element into a selector result? Thanks.
.ajax partial response
I'm having a problem using .ajax to request a page and display the content ( partial content ) as it returns in chunks. I'm using django for the site and I return an iterator using the HttpResponse object. return HttpResponse(myiter) Now if I request the page normally I see the data come back in segments. This is important because the page is searching for things and it takes time to complete a large search. localhost:33001/app/search?name=billywilly&domain=enie That returns the results as they
retrieve onchange attribute
Hello, My (php) framework generates code with onchange attributes for selectboxes like: <select id="example" onchange="alert('test')"> etc.. With jquery I need to retrieve the onchange string and pass it to a custom combo. But $("select[@id='example']").attr("onchange"); gives this: function onchange(event) { alert("test"); } instead of: "alert("test")" What am I doing wrong?
How to close/open all divs?
I have some code that I adapted from http://bit.ly/d0WnC5. I am trying to figure out how I can create a link to close all open divs or open all divs? My current code: http://sshakir.pastebin.com/JfAqHbUw . Thanks for any help you can give.
Getting image height
I need to get image height without using .attr and add it to div style. I got something like that but it's not working. <img alt="photo-current" src="images/galleries/1/photo_1.jpg" id="photo-current"/> <script type="text/javascript"> jQuery(document).ready(function($) { $("#photo-current").load(function() { var imageHeight = $(this).height(); }); $('div#slideshow').css({'height' : imageHeight}); }); </script>
My first gallery app
Hi there I have been experimenting with jQuery for the first time this past week. I thought that I understood it well enough, but now something isn't clicking. I tried to write a simple image gallery but it just does not seem to do what I expected it to. Here is my code: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="jQuery.js"></script> <style> ul li{
$get not defined, jquery seems not loaded, but checked the pathes, are all right
I got this error in Firebug "$get not defined". checked lot of threads, looks like the jquery.js is not correctly loaded. However, i tried absolute path, relative path, link to the website, move the includes to different places in my code. still get this error message. Any one can tell what my problem is? I am trying to get the google streetview displayed in my application. If I change to pure javascript, Firefox works great but IE 8 doesn't display anything or doesn't popup properly. So i want to
opening a new window and hiding the addressbar and statusbar of the window
hi, i need to create a new browser window when we click on a button, as we do with window.open() in javascript.. i was using that initially, but i was unable to set title of the html page and hide the addressbar and statusbar using it, i tried many things. but its not working in mozilla. i know that mozilla forces the default settings but i think there should be some workaround for this problem is their any way in jquery to both this things. here is what i am trying to do in javascript var
Confused by ajax xml parsing
I keep getting a parseerror using the basic AJAX function. I know that the XML file I am sending is as follows: <?xml version="1.0"?> <response><Player><gameIndex>0</gameIndex> <name>Billy</name> <coins>25</coins> <tickets>9</tickets> <id>234234</id> <guildId>4</guildId> </Player> <Player><gameIndex>1</gameIndex> <name>Mitch</name> <coins>0</coins> <tickets>9</tickets> <id>234235</id> <guildId>4</guildId> </Player></response> This is, obviously,
Need help to make simple marquee/ticker with fading left and right
on my new website i was looking to get a ticker/marquee with fading on the left and right like on below link http://www.stockshifters.com/ the part called lots closing today can anyone please help me with how this can be done please
Using js inside loaded (by load()) content. Script not doesnt apply to elements loaded by load().
Hi everyone, I'm new to AJAX. I got a page with menu on the left and content on the right. Links in menu load content which consists of: <a class="x" name="y">link</a>. My script looks like that: <head> <script type='text/javascript'> $(document).ready(function(){ $("a.x").click(function(event){ event.preventDefault(); $("div[name='content']").load($(this).attr('name')); }); }); </script> </head> <body> <table>
Need Help with navigation buttons for a gallery.
Hello to all, I am a javasrcript rookie (not much experience). The thing is I am trying to create a navigation bar for the full-page-slideshow gallery I found here (http://www.javascriptkit.com/script/script2/fpslideshow/index.shtml). It uses jquery so I am not completely helpless... For starters I am trying to create abutton that pauses the cycle of the images array For every image the script creates a thumbnail. If you click on a thumbnail. The cycle stops and the image is change according to the
Nav bar -- highlighted by current div
I have a navbar numbered 1 thru 6 for a slider. You can see it here. http://gtwebconcepts.com/tim/ Is there a way to have the current navigation number share the rollover state? In other words, if I slide to #4 then the actual navbar #4 displays in a different color until I navigate away from it. I originally thought that this would be a simple CSS thing, but that idea went more towards javascript 'test'. Then I wondered if there might be a plug-in for this sort of thing. Any thoughts?
make fields allready preset with random text?
I have a site, im expecting a few hundred colleagues to sign up, they have the chioce to pick a user name and email adress of their choice, but to speed things up a bit I would like set preset usernames and emails in the fields so the user just has to press the enter button. So for example, my 2 fields will be filled with something like Username: [mysitename]User[randomnumber] Email: [randomnumber]@mysite.com where my site name is the actual name of the site, and the random number will be different
toggle $(this)
Hello, I have what I think is a basic question. I will have multiple li's of the same structure below on the same page. I click "more" and then the overlay appears. The only issue is that it appears for each instance. I understand why but I don't understand how to use the $(this) to isolate the interaction. Any help would be appreciated, thanks! <li class="marketingItem"> <div class="thumb"> <?=img(array('src'=>'images/marketing/gil.jpg','alt'=>'Book 1'))?> <div> <div
Automatically getting DIV's ID?
Hello! I have a <ul><li> menu with links named #p1, #p2, #p3 etc. Below I have divs named #p1_c, #p2_c etc. linked to menu items. How to write one function for it to work if I have to use a href="#"? For now I have: $(document).ready( function() { $("#p1").click( function() { $("#p1_c").show("slow"); }); });
Regarding the call back function
I have just started learning JQuery and have a doubt in the below code. $.get('myhtmlpage.html', myCallBack); The doubt is should the 1st parameter of the get function be a HTML file or can it be a unction name?
Help required to 'convert' a script
Hi, I have pretty much no knowledge of any coding or scripting but I play a game which allows you to use scripts. Previously it was scripts that worked with mootools but today they changed to jquery. As a result a script which I use no longer works. My question is how can I get the script to work? Keep in mind I have no knowledge so will need to be spoonfed. If someone can help me then I'll post the script. Cheers!
Trouble with the effects and looks of my treemenu
Hello, I have wanted to create a treemenu with jQuery for quite a time now, then I found an example on http://www.dynamicdrive.com/dynamicindex1/treeview/index.htm and tried to get it working as my own version. It doesn´t seem to apply the "speed" effect when i click on the text to make it drop down the submenus..? I will apply the code to this post so you could inspect me and give some feedback if it´s not to much trouble, would be really awesome to be honest :) I am also going to type the folders
Append to Specific ID
Sorry, I am horrible at jQuery... So basically what I am trying to do is move my comment form to a specific ID on click. It happens in a smarty template, but the reply link is built via php Edit:I figured it out, thanks.
Show Alert Window
Hello, I have the following on a page: "<a class="Delete" href="/task/delete/50">Delete</a>" How can I show an alert window saying: "Delete? OK, CANCEL" If OK is clicked then it calls the url "/task/delete/50". If CANCEL is clicked then it stays on the current page. I need to apply this to all anchors with class "Delete". How can I do this? Thanks, Miguel
external contact form into overlay <- how to keep overlay layer after submit?
Hello I've spend couple hours on learning how to use basics of jquery, and I have enough :\ I made a contact form in php, and I wanted to load it into overlay layer. I achieved this, but now I have no idea how to keep the contact form on the layer after submitting the message. I need it to handle errors in form and to inform the user, if the form has been submitted. The form doesn't utilize any jscript. Is it doable ? I'm using basic overlay code to load the form from external file $(function()
Form functionality that compares value submitted to hidden fields...
So I'm new to jQuery and loving it! I've got a problem I'm not sure even where to begin. I have a form I'm going to present to visitors. The goal is that when a visitor enters a Zip Code, for the form to compare that Zip Code submitted to Zip Codes that I'll hide in the form. I'm not sure if it's better to have the hidden zip code values as comma separated or just let them have their own individual hidden input fields. When the form is submitted, I need it to check and find out if the submitted
help with closest()
I'm trying understand the closest method..I have the following <ul id="one" class="level-1"> <li class="item-i">I</li> <li id="ii" class="item-ii">II <ul class="level-2"> <li class="item-a">A</li> <li class="item-b">B <ul class="level-3"> <li class="item-1">1</li> <li id="davide" class="item-2">2</li> <li class="item-3">3</li> </ul> </li> <li class="item-c">C</li> </ul> </li> <li class="item-iii">III</li> </ul> $(document).ready(function
Ajax link actions?
I think this is a simple problem but I cannot work it out. When an ajax page is loaded into the #ajax div the links are now longer triggered. I think this is because the document is loaded and the function is run. When the new information comes into the page it isn't in the same scope as the click function. Is this correct? Is there a work around? function pageload(hash) { if(hash) { $.ajax({ url: "index.php?p="+hash+"&logo=0", cache: false, success:
How to organize the JavaScript function that uses jQuery
Hello all, I have the following code and would like to know how to move the change function $("#sweets").change outside this HTML file and use <script src=""></script> to include that function and trigger the function inside this HTML. Thank you <!DOCTYPE html> <html> <head> <style> #selecttext { color:red; } </style> <script src="http://code.jquery.com/jquery-1.4.2.js"></script> </head> <body> <div> <select name="sweets" id="sweets"> <option value="" selected="selected">-
Installation error.
JQuery was recently recommended to my for doing some animation of photos in the header of my web site. However after downloading I start the install process and get the following error almost immediatly. Windows Script Host Script: C:uDaveAppDataLocalMicrosoftWindowsTemporary Internt FilesContent.IE5M8G6K5AUjquery-1.4.2[1].js Line: 16 Char: 1 Error: 'window' is undefined Code: 800A1391 Source: Micorsoft JScript runtime error I am running a 64 bit Toshiba with
Next Page