applying var to a if statement
Need to apply a var to a statement if its conditions are met, this syntax isn't throwing errors but its not working. <script type="text/javascript"> $(document).ready(function(){ var action_is_post = false; //stuff here $(this).ready(function () { if ($("#stepDesc0").is(".current")) { action_is_post = true; } }); //stuff here </script> should I use something other than .ready? I need it to apply the var when #stepDesc0 has the class current. Thanks!
Can I simplify this?
I have 5 li's that include radio buttons. If you select "Yes" on any of the 5 radio buttons it slides down a warning and clicking no makes it slide up. Is there a way to simplify this so I don't write the same code over and over changing input id's? <script type="text/javascript"> //Show/Hide professional Status $(document).ready(function() { $(".Pro").hide(); $("#SECYes").click(function() { if($(this).val()==="Yes") $("#SECPro").slideDown("fast"); }); $("#SECNo").click(function()
table jquery problem
Hi folks I want to append a row in my table with jquery. The append works but it must be possible to edit that row. I can edit the other rows, but I can't edit the newly added row. Here is my code: for adding my article to the table: $.post('./addArticle.php',{articleid: articleid, info: info, code: code, price: price},function(data){ if(data != ""){ $('#addArticle').fadeOut('fast'); $('#overlay').fadeOut('fast'); $('#artTable').append(data,function(){
jquery ajax problem on IE and Firefox, but not Google Chrome.
Hi, I am having a problem where my IE (IE8) doesn't process a form using jquery ajax. Instead, it navigates to the target page (the page that receives the form data). I didn't want that. Okay, take a look at my code portion [base.js] function ExtConn() { this.getHTML = function(_url, querystring){ try{ bodyContent = $.ajax({ url: _url, type: 'POST', data: querystring, async:false }); //alert(bodyContent); return bodyContent.responseText; }catch(e){ return false; } }; this.sendForm =
Sharepoint List form with Jquery
Hi, I would like to know if there are any references available on sharepoint List and Jquery. Currently i am using Content Editor Web Part for the integration but the web part itself is only availabe on the list page the new and edit page i am still unable to add the web part.
Treat each group of li's independantly?
Hi, friends, in this code I may have serveral ul's How can I apply this so that it treats each group of li's independantly? ie the numbering starts fresh for each ul group? <script type="text/javascript"> (function($){ $(document).ready(function() { $("ul > li").each(function(i) { if (i % 2 == 1) { $(this).addClass("odd"); } else { $(this).addClass("even"); } }); }); })(jQuery); </script>
Event only firing for first element on page
Hi all! I have the following code: <script type="text/javascript"> $('#hover').mouseover(function(){ $(this).animate({height:200,width:200}); }); $('#hover').mouseout(function(){ $(this).animate({height:60,width:60}); }); </script> ...which I thought should fire for the id="hover" element which the mouse is over, regardless of index. Unfortunately, it's only working for the first hover element on the page.... Any thoughts? Thanks in advance!! Tim
Assigning values to variables via ajax loaded script
I am trying to assign a value to a java variable inside the script that I am calling via ajax but once the call is over it shows variable as undefined: $.ajax({ type: "GET", url: "getdata.js", dataType: "script", success: function(){ alert( typeof data_array ); }, error:function(){ alert("WTH"); } }); getdata.js: <script type="text/javascript"> data_array=[1,2,3] </script>
Applying variable if hidden input value is xx
Hi all, Basically I have several hidden inputs, each with different values. I need to do something like: if ('input:hidden').val('===1') { var foo = true; }) I know this is not right. I need to get the hidden input's name in there somehow. Help is always appreciated! Thanks, Kane
overriding onbeforeunlod for first step in form wizard
This pertains to a form wizard with 5 steps, I don't want the user to hit back and lose form data in any step 2-4. I have added a flag for the submit function and need to add this one for the first step. If they get there by accident and try and leave I dont want the cofirm dialog popping up. <script type="text/javascript"> $(document).ready(function(){ var action_is_post = false; $("form").submit(function () { action_is_post = true; }); //this is the trouble spot. on the first
vertical list of images?
I am trying to program a site with a vertical "pile" of images. This will simply be an unordered list of images. The part where jquery comes in is that I want the list to vary according to the height of the viewport. If I load a page with lots of content I want the list to show more images, so that it "fills" the page. I could of course just make one image and use it as a background and repeat it vertically, but the effect I'm looking for is non-repeating content.
[solved] css left as integer rather than px value
hi, i need to do some arithmetic on the returned value from: var left = $('.object').css('left'); it comes back as px value, but i need just the number.
Add TR to table, then apply css to it
Is there a easy way to add a new TR to a table and then apply some css to it in one hit. Like, once the new TR is appended as the last row in the table, take the new row and add a class. Just wondering if there was a better way then using $("tr:last") twice. $(function(){ $('#donations').csv2table('docs/donations.csv', { sortable: false, onload: function(id,op,data,ary) { $("tr:last").after("<tr><td colspan=\"4\"><strong>Total:</strong></td><td></td></tr>");
Problem with loop function
Hi, I'm a bit of a jquery newbie but I'm having a problem with something. I have some effects being run on html tags which fade them in, delay, fade out, typewriter text, etc. What I'm trying to do is once the last effect is finished for everything to fade out for a couple of seconds, fade back in again and begin over again, having it keep looping. Any ideas would be much appreciated... $(document).ready(function(){ $('.flashline1 span').fadeIn(400).delay(500).fadeOut(400).delay(500).fadeIn(400).delay(500).fadeOut(400).delay(500).fadeIn(400);
How to get this script to update automatically
I'm new to jQuery and a Javascript novice. I would love some involvement in developing the following script. It keeps three liquid columns to the same height even though their contents vary. It works fine until the browser window is dragged to a new size. There are lots of things that could be done to improve it but getting it to adjust as the window is dragged to a new size is my immediate interest. Thanks to anyone that can help. <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.min.js"></script>
Quick question on streamlining .load() parameters
I'm using a couple of snippets to load external files into a target div. It's working great. The problem / question is "how can I reduce the code needed" . Basically I have two menus on each page, a set of tabs and a footer text based menu. Both are designed to summon the same content into the same target div in the same fashion. Here's the code i'm using. Notice how i've had to repeat it, once for the tabs menu and once for the footer menu. <script type="text/javascript"> $(document).ready(function()
jquery datepicker
How can i set the today's date in the datepicker as that of servers today's date.Datepicker is taking my local systems date as the currently selected date.My server is in US and i am(my system) in japan i want to get the US date on my datepicker as the currently highlighted date instead of my systems(which is set to japanese time)
Using Checkboxes with Select Options
I currently have a form that the checkboxes are automatically populated. There is over 1000 checkboxes in total, 48 of these checkboxes are designed as main topics, when the checkbox for one of these 48 are ticked, it checks all sub catergory checkboxes as well as populates a <select><option> multiple list with its value. When unchecking one of the 48, it unchecks all its sub categories and removes them from the <select><option> multiple list. The problem I am having is, when i select one of the
Need help fixing navigation menu
I am using JQuery for a navigation menu which adds a "selected" class to its links depending on which page is active. This is what the HTML code for the menu looks like: <div id="nav"> <ul> <li><a href="index.php">HOME</a></li> <li><a href="gallery.php?categoryID=1">GALLERIES</a></li> <li><a href="news.php">NEWS</a></li> <li><a href="links.php">LINKS</a></li> <li><a href="contact.php">CONTACT US</a></li> </ul> </div>
problems using jquery Hover event
Hello I am having problems with the jquery hover event. I have an absolutely positioned div with a child div inside it. while mousing over the div the handlerIn and handler out functions keep firing while moving the mouse through the div. Here is the html and css for the div in question.... <div style="top: 246px; left: 387px; width: 58px;" class="booking offlineBooking"> <div class="label">giigs, ryan</div> </div> .booking.offlineBooking { background:url("../images/booking_bg_blue.gif") repeat-x
Dynamic validation
I am so new to jQuery, but i'd like you help please. If i have a form with questions on them, but then have questions (who's visibility and validation requirements) that are dependant on the answers from another question; how can i place validation in the jQuery to accommodate this? Oh yes can anyone recommend a good book or ebook or website to teach me what i need to know about jQuery. Thanks
jQuery newbie question
Hello I have the following line of code: $('#'+'productdiv').slideUp(300).delay(800).html(req.responseText).fadeIn(400); The html(req.responseText) always seems to execute before the slideUp, delay, and fadeIn. Is there anyway of preventing this from happening in the incorrect order - i.e. I would like the html to change only after the old html has slid up... This behaviour occurs in both IE7 and FF3. Thanks in advance.
sending AJAX post id for MySQL delete
Hi guys, I am trying to do something simple in PHP but using jQuery AJAX. I don't know about Javascript, so take it easy on me! I have made a deleteajax.php require_once('../Connections/conn.php'); //database connection if($_POST['id']) { $id=$_POST['id']; $id = mysql_escape_String($id); mysql_select_db($database_XXXX, $conn); $sql = "DELETE FROM students WHERE student_id ='$id'"; mysql_query( $sql); } and using this script on the main page <script type="text/javascript"> $(function() { $(".delete_button").click(function()
$ in id causes selector to fail
I'm trying to add some functionality to a existing application. I have no control over the input element ids. There are inputs I need to use that have $ in the id <input id='field1$0'>. Trying to use the id selector $('#field1$0') fails (result is undefined). Is this a bug or "by design" in qQuery? Is there a workaround, other than looping thru all inputs to find the ones I need? Thanks Dan
Documentation as PDF for off-line reading
There really should be a PDF, or at least a single, huge HTML, version of the documentation so that one can save time by learning before using. On-line docs are good for detailed information on specifics. But they are no substitute for reading documentation beforehand, and really getting to know things. Any plans?
Make Text in DIV Scroll
Hey all, I am rather new to jquery and have run into a problem that I have not been able to figure out myself...hopefully someone will be able to assist me. I have a div 500 px high with text in it. The text takes up more space the provided and I wanted the DIV or text to scroll up as the mouse neared the bottom of the div. It is pretty simple and straight forward, but I can not figure it out. Any help would be greatly appreciated. Thanks!
show / hide id within tab panel
I have a tab panel which loads external content dependent on the chosen tab. Due to space issues i would like the content to be expandable via show/hide functionality, however I can't seem to figure out a way to target the #expandpanel id within the tab panel when the tab panel content is loaded as an external page. Can anyone proffer any advice? Regards
JQuery session
I have a problem when manipulating with session by using JQuery. In my JSP, I set session by "session.setAttribute("booking",Yourbooking);" Then, I want to delete the session when clicking button with identity "destroy" But I donot know how to do it. I only include regular JQuery.js file, nothing else. Do I have to include some more? <script> $(document).ready(function(){ $("#destroy").click(function() { var destory = $.session("booking"); alert(destroy); return
Check single class from multiple?
Hello is there a way I can get at a single class when many are defined? var tabClicked = jQuery(this); if (tabClicked.attr('class') != "current") { } The script above doesn't work because the class has multiple definitions i.e. class="tags current" Is there a way to easily find a single class out of many? Thanks in advance Chris
How to encode and submit local variables via ajax POST?
I have a collection of local variables populated via Flash movies and scripts, and now I need to submit an ajax post (can also be get, but prefer post). I have tried: $.ajax({ type: "POST", url: "/myurl", data: "p1=" + localParam1 + "&p2=" + localParam2, success: function(msg){ alert( Bingo: " + msg ); } }); The problem with this is the encoding of the localParam1 and localParam2 sometimes breaks the normal & delimeters. An even more problem is I sometimes have upwards
Jquery solution needed
I have a requirement . Here I am attaching the requirement requirement.txt I'm using simple javascript to meet up this requirement . Here is my javascript function attached which meets up this requirement . please find the javascript.txt attached. Although this javascript function working , the script is very very slow and time consuming . Is it possible to use JQuery to make this faster ? How ? Alternatively, what changes I need to make the script faster ?
looking or suggestions on understanding ajax asyncronous issues
I will make a series of ajax calls on my page. The first one calls a php script that will run for a very long time on the server. While it is running, I call other php pages via ajax to do other things. All calls are being held up waiting on the first one. I'm just watching them fire off in firebug. i used async:true in the setup just to see if that would help. But this should be the default. I also placed timeout:5000 hoping that the first call would timeout and just keep running on the server
Not recognising closest span
My HTML looks something like the following: <label for="myTextBox"> Name:<span style="color:red;">*</span> <input type="text" id="myTextBox"></input> </label>In my document ready I have a function which runs 'on blur' of the textbox and hides the span. The following code DOESN'T work to hide the span: $('#myTextBox').closest('span').hide();I'm currently using the code below which DOES work but was wondering why the above code doesn't.... $('#myTextBox').parent().children(':first').hide();Thanks.
Newbie Needs Help! Internet Explorer Issues
Hi guys I'm stuck with a problem and my programmer is out of town and was hoping some here can help me out. If you look at this page: uitstor.net the drop down on the right works in all browsers except for Internet explorer. After doing hours of research I found this forum and really hope someone can help me out. Here is the scripting on the page if you dont want to go visit the site: <script> function remember_choice(region) { if (!region) return; var date
ajax method is not called after the first invoking at IE
$("#test").droppable({ tolerance:'touch', drop: function() { $(this).find("table > tbody").append(newRow); $.ajax({ url: "myUrl"}); } }); The above code works fine at Firefox and Google Chrome. And it works at IE 8 for the first drop action. The ajax method is not called after the first call although the append still works. Is a beg with jQuery or usage issue?
jQuery not loading?
i keep getting this problem of the jquery not loading so none of the javascript works... any idea what is happeneing? this site should open up, the link should drop down... http://pullenworks.com/rachel/ cheers! dave
select option:selected
This doesn't seem to be working: var status=$('#status').text(); $('#statusSelect').find('option:contains(status)').attr('selected','selected'); I have confirmed that the event fires and that there is an option that matches the value of 'status' but the select box is getting updated. Any ideas?
Select dropdown with many, many Options, most efficient way to populate?
I am populating a number of Select boxes on the server-side with a large number of options. I'd like to get the response size down without taxing the client browser too much. What do you think is the most efficient way to approach this problem? Here are some considerations: - The option text/values do not change very often, but could potentially change in the future. - The page that holds the select boxes should never be cached, there are other aspects of the page that need to remain fresh. -
Selection question
I need the syntax for selecting elements subordinate to $(this). More specifically: - I have a number of wrappers on the page with a class 'myWrapper', and can find and iterate through them all with $('.myWrapper).each(function() { }. - Inside the function, I can refer to each of the found items as $(this). I now need to find all the radiobuttons inside $(this), and not any outside of that. What's the syntax? Thanks!
Why does $('#') throw an exception?
Why not just return an empty set, just as it does when you call $('#this_id_does_not_exist')?
Next Page