Attaching the same event to mutiple selectors
Hey there all, I have a list of 7 days (mon-Sun), and I am asking users for times in each day. I want to add a radio button to each day that says Not Available -which would set the times to 0, and fully available, which would set them for 24. I can do this for each day separately $(document).ready(function() { $("#monday-radio").click(function() { $("#monday-times).slider('option','value', 24); }); }); I know its not perfect but it works for the example. I could write this code out for each day,
[jQuery] Clearing data from function between uses?
This code attempts to determine the position of the browser scroll bar before clicking to a feature and then return to that position when the feature is closed. It works. But it is also building a history of every position for every time the feature is used, which I don't want it to do. So, the first time one clicks to the feature and closes - works great. But after that, upon closing the feature, the browser runs through every previous position before settling on the correct one for the current
$.get(URL, fn) complains about , ?
According to [the main jq site|http://docs.jquery.com/Get] I can use, as an example: $.get('http://www.google.com', function(data) { alert("data:" +data); }); to load asynchronously and alert after load. But it always complaining about the comma saying other chars expected? Are the Get docs out of date or is there a trick to getting the $.get to work? Cheers
[jQuery] problems with filter() a variable ajax response
I ma having trouble with this for a few hours and thought id post to see if i can get help. I am trying to use ajax to load an element from another page. i can see the response and the id element i am looking for inside but i can get nothing but a null value trying to extract the html() im using variations of this: jQuery.ajax({ url: 'index.php? option=com_resource&view=list&category_id=9&user_id=64&layout=useritems&view_what=created&Itemid=0', timeout: 0, error: function() { console.log("Failed
[jQuery] hide parent div according to span containing some text
I have html generated by php (several html codes like below): <div class="header"> <a href="node/188?slide=3" class="previous"> Previous </a> | Image <span class="current"> 1 </span> of <span class="total"> 1 </span> | <a href="node/188?slide=2" class="next"> Next </a> </div> What i need to do is to hide "header" div if span class "total" contains number 1. (like it is in above example) I tried code something like this but no success: $(document).ready(function() { if ($('.total').contains("1") {
[jQuery] Jquery Upload issue
Hi all, I have a probleme with uploding file using ajaxForm The probleme is not in data submission or in receiving but the form dont submit wih httprequest (without choosing a file the ajax form work fine ) . Thank you .
[jQuery] how to parse data obtained from jquery ajax call
$(document).ready(function() { $.ajax({url: '/page/test.html', type: 'GET', dataType: 'html', timeout: 5000, error: function(){ alert('error'); }, success: function(data){ var dom = $("div/p",data); $('#parse_result').append(dom); } }); }); // test HTML <div> <a>test dom tree</a> </div> I just can't get the code work because dom is always null actual html is more complex, I just want to use the xpath to navigate through the getted html of course this is perhaps
[jQuery] Selectively load js files
Hi, I'm looking at including jQuery UI in a project I am working on, but one of my concerns is the large size of the full file. I was wondering if there is something easy or built in that would allow me to load only which jQuery UI plugins/effects I need on a particular page. So, something like: loadUI({"core","accordion"}); Does that make sense? And each file would be separate on the server, so they get cached. (like individual <script> tags loaded, without going through all that hassle)
[jQuery] Send $_FILES thorugh ajax using jQuery
Hi there guys, I want to build an ajax upload script using jQuery. The problem is that i can't find a way to send the $_FILES Can you help me? Thank you Sincerely, Alex
[jQuery] [tooltip] dynamic update
Hi, I need to update tooltips dynamically, but has no easy way for this. After rummage jquery.tooltip.js I found them, just add following lines at beginning save() method: if (this.title) { this.tooltipText = this.title; $(this).removeAttr("title"); } and then use dynamic titling with nature way: $("#id").attr('title', 'New title'); if it's possible - add this trick to jquery.tooltip.js, thanx!
[jQuery] DOM Rendering is not finished before ThickBox tried to display = Grey Screen
Hi. I have a problem of getting a "grey screen" instead of grey screen with JQuery ThickBox on top of that. I need to open ThickBox on page load. It seems that sometimes! DOM is not finished when ThickBox is trying to modify it. Here is a code I have at the end of my .jsp file (showWarning() just opens a ThickBox) </form> <script> formElement = document.shippingRulesArrayForm; window.onLoad=window.setTimeout("showWarning()", 1400); </script> Note: even if I put this code in footer, it still sometimes
[jQuery] jquery html parse
$(document).ready(function() { $.ajax({url: '/page/test.html', type: 'GET', dataType: 'html', timeout: 5000, error: function(){ alert('error'); }, success: function(data){ var dom = $("div/p",data); //can I use jquery xpath mechanism to parse the html data $('#parse_result').append(dom); } }); HTML <div> <a>test dom tree</a> </div> });
[jQuery] code review for short snippet
I'm not new to web development or javascript, but am relatively new to jQuery. I'm wondering if someone would be willing to quickly review the following code for efficiency and best practices. The function works as required, but I'd like to take this as a learning opportunity. In a nutshell the code initially hides two divs onload and then the function shows/hides the state/province divs depending on the value of the country dropdown. I want to keep the code readable, but I know it could be tighten
[jQuery] Executing javascript that comes inside an AJAX response
Hi, I'm trying to use jQuery to get some HTML with Javascript using AJAX. My response gets inserted into the contentDiv element but my javascript inside the response doesn't get executed as the documentation says (http://docs.jquery.com/ Specifying_the_Data_Type_for_AJAX_Requests). Here goes my function with AJAX call: function loadHtml(obj) { if(obj.className == "menuItem") { $.ajax({ type:"GET", url:"content/" + obj.id + ".html",
How to modify an option in a select list (drop down menu)
My first post here. I can't get my head around modifying a select list so only the item I have appended becomes the selected one i.e. I need to find the one that is already selected and remove 'SELECTED' so it is no longer selected. Here is the outline of my code....... //Here is the simplified code. (actionOptAdd is activated on the click of a submit button. jSON is used to get the data returned from a PHP function) //--------------------------------------------------- $(".actionOptAdd").bind("click",
[jQuery] iframe ang jQuery
Hi Guys is it possible to embed a php website on an asp website using jQuey or is possible to create a dynamic height iframe for embedding another website running a different technology? Thank you.
Use jquery before the DOM is ready?
I'm trying to have jquery set an image's opacity to 0. Then, while the image is fully loaded, it will fade the image in. It seems to work fine, unless the images have already been viewed in the browser and are stored in cache. In this case, the image is already loaded by the time of $(document).ready, then it fades out, then fades back in. I'm doing it like this: $(document).ready(function() { $("#mainimage").animate({opacity: "0"}, 0); }); $(window).load(function() { //when everything is finally
[jQuery] jeditable and validation / reverting to original value or retrying
I'm successfully using jeditable to submit via a function using jQuery.ajax and the async : false option , but am having an issue aborting if an error is returned. How can I get the edit box to stay activated and / or revert back to the original value if there are errors? I'm returning http status codes. so something like // async : false .ajax submit here... if (xhr.status == 200) return value; else { alert ('returned error'); // keep edit box activated but available for another try, or revert back
[jQuery] A silly question from a newbie
Hello. I have a page that loads another page and I want to change the height of an element in that other page: <script type="text/javascript"> $(document).ready(function(){ $("#page").load("page"); $("#main").css("height","111px") }); </script> That doesn't work, #main is inside #page. Thanks in advance! -- View this message in context: http://www.nabble.com/A-silly-question-from--a-newbie-tp22878466s27240p22878466.html Sent from the jQuery General Discussion mailing list
[jQuery] A silly question from a newbie
Hello. I have a page that loads another page and I want to change the height of an element in that other page: <script type="text/javascript"> $(document).ready(function(){ $("#page").load("page"); $("#main").css("height","111px") }); </script> That doesn't work, #main is inside #page. Thanks in advance! -- View this message in context: http://www.nabble.com/A-silly-question-from--a-newbie-tp22878466s27240p22878466.html Sent from the jQuery General Discussion mailing list
[jQuery] How to wait for getJSON to complete before continue?
can i want for getJSON to complete before excecuting code? cos i am validating my input. and i need some values from server 1st. so apart from putting all code that is to be executed after getJSON() inside .getJSON("url", function(json) { // *** here *** }); can i have it outside? and how can i access the json object outside the .getJSON("url", function(json) {}); function?
[jQuery] effect similar to windows task bar in auto-hide mode
Hi I'm looking for a quick and easy way to have an effect similar to that of the windows taskbar in auto-hide mode. It would be especially nice if it stayed at the bottom of the page even while scrolling. Suggestions?
AJAX loaded jquery sriped table
Hi I am using JQuery Tabs plugin which can be found here: http://stilbuero.de/jquery/tabs/ The problem is that the content returned from my AJAX Call is a table which i want to stripe even/odd rows. but $(document).ready(function(){ $("table.striped tbody tr:odd").addClass("odd"); $("table.striped tbody tr:even").addClass("even"); }); doesn't work for tables returned by AJAX Call but works on any static tables. please help.
[jQuery] code review for short snippet
I'm not new to web development or javascript, but am relatively new to jQuery. I'm wondering if someone would be willing to quickly review the following code for efficiency and best practices. The function works as required, but I'd like to take this as a learning opportunity. In a nutshell the code initially hides two divs onload and then the function shows/hides the state/province divs depending on the value of the country dropdown. I want to keep the code readable, but I know it could be tighten
[jQuery] Closing Ajax Requests
I couldn't find anything on this in the jQuery documentation. Is there a way to close all jQuery ajax requests? I've built a bit of comet- like long polling ajax script, but it seems as though Internet Explorer is keeping these long polling requests open when I refresh or redirect to another page. Sense IE has a 2 connections per domain limit, the client would have to wait till the long polling is complete (which takes roughly 1 minute) before the other pages load. So what I need is a way to stop
[jQuery] Thank you John Resig
I just want to say, thank you John. I have been developing sites with jQuery for the better part of a year and it has just made the amount of work I can get done sky rocket. Now, however, I just started a new job this week and they are using YUI. I have been patient and have spent the better part of 5 days trying to do the most basic things the YUI-way and I'm falling flat on my damned face. I have actually resorted to writing code using basic DOM api functions simply because YUI is so frakking hard
[jQuery] fade effect not working in IE
Hi, When I load the following jquery, the load effect collapses in IE. You can see what I mean here: http://m1.cust.educ.ubc.ca/. The buttons in the middle of the page are supposed to load new content. Any ideas what's wrong? $(document).ready(function(){ q1 = { init: function() { $(".loader1").click(function() { $("#fader").fadeOut('slow', function() { $(this).load('homepage_text/ 0.php').fadeIn('slow'); }); $("#featureBanner").fadeOut('slow', function() { $(this).load('homepage_images/ 0.php').fadeIn('slow');
[jQuery] Is there a way to get a link to submit like a button?
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"> <meta name=Generator content="Microsoft Word 12 (filtered medium)"> <style> <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face
[jQuery] not working in IE.
Hi. I'm new to JQuery. We have a system that dynamically generates pages from the database. The users want some of the pages changed. I'm trying to use JQuery to modify the pages on the fly so I don't have to mess with the vendor's code. below is my code as I'm just starting out. It works perfectly for Firefox and Chrome, however, none of the changes appear in IE. I don't know where to start debugging this thing. Please help. $(document).ready(function() { /*********************************************************************
[jQuery] jQuery and Ruby on Rails
Hello all, I have been reading a lot and can not find what I am looking for. I have a Rails project, and have written a script to get the class of a ul. I want to pass this variable gathered from the script and pass it on to Rails. How would i got about doing this? For your information: I wrote this jQuery script just so I could set a variable name to the name when the mouse is clicked on the UL. From then the I can delete the file from the server. Thank you, Phil
[jQuery] Plugin search
I have been searching for a jquery plugin that has a similar feature to ext.js and the Border Layout that can scale and or collapse a div on click or drag, while scaling the right larger div, see it here (Left Nav) http://extjs.com/deploy/dev/examples/layout-browser/layout-browser.html
Ocasional Bug!
Hello all, I made myself a small script, to change the background color of a div and the image inside it. However sometimes, when i mouse out or mouse over it, they don't work. But this is something that happens like 1 every 20 times. And i have no ideia, why this is happening! Im to "newb" in JQuery to solve this issue //BOTTOM $(document).ready(function(){ //esconder imagens $("#imgone").fadeTo("fast", 0.0);$("#imgtwo").fadeTo("fast", 0.0);$("#imgthree").fadeTo("fast", 0.0);
[jQuery] ajaxForm + IE + file upload + you
I just solved a nasty bug on my end and thought others might benefit from my pain. Our form code handle lots of different types of data. And forms can be loaded individually via AJAX. I recently started converting all of this code to jquery.ajaxForm. When ajaxForm submits a form that has a file, it opens an iframe, copies your filled-in form to the iframe, submits the form *in the iframe*, then copies the response back to you. Very nice. Unfortunately, if your code doesn't return fully valid HTML,
[jQuery] dynamically reload your data in json (for categorical filtering)
What's going on here? We're pulling in a json object with all of our data (itemListMaster) and keeping a record of it to parse data from later and populate our default json object (itemList). I'll comment in the code below to explain what's going on. ### the code ### var mycarousel_itemListMaster = [...]; //pull in/assign the data here var mycarousel_itemList = [...]; //same as above var carouselObj;//global object for your carousel //this is the function we will be using to reload our carousel with
[jQuery] All div content showing up in jQuery Tabs
For some reason, when my first div loads, I'm seeing all 3 text show up even though they're in different <div> containers: <script type="text/javascript"> $(document).ready(function() { $('#Tabs div:Form1Content').show(); $('#Tabs').tabs({ fx: { opacity: 'toggle'} }); }); </script> <div id="Tabs"> <ul> <li id="PTab" runat="server"> #Form1Content Images/Product/tab1.gif </li> <li id="OTab" runat="server"> #Form2Content Images/Product/tab2.gif </li> <li id="RTab" runat="server"> #Form3Content Images/Product/tab3.gif
[jQuery] All div content showing up in jQuery Tabs
For some reason, when my first div loads, I'm seeing all 3 text show up even though they're in different <div> containers: <script type="text/javascript"> $(document).ready(function() { $('#Tabs div:Form1Content').show(); $('#Tabs').tabs({ fx: { opacity: 'toggle'} }); }); </script> <div id="Tabs"> <ul> <li id="PTab" runat="server"> #Form1Content Images/Product/tab1.gif </li> <li id="OTab" runat="server"> #Form2Content Images/Product/tab2.gif </li> <li id="RTab" runat="server"> #Form3Content Images/Product/tab3.gif
[jQuery] FadeIn/Out mulitple images in one container
There's a pretty simple image replacement I'm trying to do, but can't get the current image to fadeOut, and the new one to fadeIn. There's only 3 images to choose from and always will be. With those 2 lines commented out, it works, just obviously without any kind of fade. I'm fairly new to jQuery, so any help would be greatly appreciated. $(document).ready(function() { $("#lakeview-gallery a").click(function(event) { // $("#lakeview-placeholder").fadeOut(800); // $("#lakeview-placeholder").fadeIn(800);
[jQuery] multiple dynamic jcarousel instances
Hello, I'm working with the jCarousel plugin and would like to have multiple carousels on one page, each dynamically pulling the scrolling items from an array. I am wondering what sort of modifications I would need to make to the jcarousel_functions.php file and page xhtml to accommodate 2+ instances? Here's my sample: http://static.spartaninternet.com/sandbox/carousel/ And here is the code from the jcarousel_functions.php file: <?php $jcarousel_items = array( array( 'title' => 'Face 1', 'src' =>
having problemt with jquery load() in IE
Hi, I have a situation where jquery .load() function works in FF and not in IE. var url = 'someURL'; $("#mailPreferencesDiv").load(url + " #mailPreferencesDiv"); the above code loads contents properly in FF but in IE it sets the content of the div with id mailPreferencesDiv to empty string. Any idea why would it be doing so? Thank you, Raghav
[jQuery] How to get Superfish to display outside frameset boundary
I am developing a horizontal menu bar using Superfish. I have configured it using a simple file, no problems, now I am trying to integrate it into my site. The site uses frames (can't get around it) for a header, TOC, body. The menu bar is in the top "header" frame, right at the bottom of the frame. Unfortunately, the Superfish menu popup does not appear because it is "cut off" or clipped by the frame it's in. I tried the bgiframe plugin in hopes it would work, but it didn't (probably not what it's
Next Page