jQuery change event placed on file input inconsistent between Firefox & IE
I recently upgraded to jQuery 1.4 from 1.2.x and have found that the following code, which previously worked across all browsers, no longer works seamlessly in Internet Explorer: <form id="myform"> <input type="file"> </form> ... $('#myform input).change(function() { alert("Someone picked a file") }); ... In Firefox, this code continues to work like it did prior to 1.4, namely, as soon as the user picks a file, the change event fires. But in IE 7 (the only IE I've tested it in) the change event
Is there an Event triggered when the User "sees" a certain Element?
Is there an Event triggered when the User "sees" a certain Element? The case is: i want to execute an function when the user is scrolling down and reaching a certain point/element. At the moment I'm doing so by using scroll and the position of the element: $(window).scroll(function(event) { if($(window).scrollTop() > ($('#element').offset().top - 800) && 'true' != activeautoload){ activeautoload = 'true'; function_load(5); } }); But i'm not a 100% percent on this since the offset().top seems to vary
matching an element's class to another element's ID, or *part* of another element's ID
hello again Such a simple concept but I'm struggling to express it ... apologies in advance for my verbosity. I have a container div with a class, e.g., <div id="container" class="apples">; I want to use that class to do two things: 1. add a class (e.g., 'active') to the nav element whose ID matches the class of div#container (e.g., #nav-primary li# apples) 2. add the same class to another element if *part* of this element's ID matches the class of #container (e.g., div#secondary-apples) I assume
Div to disappear when clicking outside it
So, I have a content div and a floating sidebar (that's draggable). When I click on the content div, I want another div (with id #formatting) to appear inside the sidebar. This is already working. When I click outside the content div I want the #formatting div to disappear — but if I click inside the #formatting div it also disappears. How can I get it to stay there when I click inside the sidebar? Should I use an if statement, or are there other options? $('#content').focus(function() { $('#formatting').show('fast',
trouble getting external content into div - HELP!
I have exhausted a dozen hours researching and tinkering with having a list of thumbnails representing staff members that when clicked on will display their profile in a target div. Each thumbnail link points to an external html page with the content held in a div with the id of #bio. Here's my code: $(document).ready(function() { $('.active_bio').fadeIn('fast'); $('#biothumbs li a').click(function() { var toLoad = $(this).attr('href')+'#bio'; $('#bio').hide('fast', loadContent);
check file extension when user sets it in the file input
hi, is there a way to assign an event to a file input so that when a user selects a file to upload the event is triggered and i can check out the file extension? The reason why is simple, i want to perform different actions depending on the type of the file. Any suggestions? Thanks in advance!
.ajax and charset on request header
Hi all. I have windows-1250 encoded database, and that is no way to change. My web pages have set content-type to "text/html; windows-1250". But when I call $.ajax with or without beforeSend to modify header, no matter, he is sending data with charset utf-8. do you have any idea?
.load slows down
Hello I use following code to create an element and load data into it onclick: ("<div id="element" ></div>").appendTo('#content').load("grid.php"); The first time it loads very fast, 12ms. I have a close buttons wich removes the element from dom: $("#element").fadeOut('fast').empty().remove(); The second time I execute the onclick event, the first code takes approx 1 second, so much slower. The php code execution time is the same as previously. I'm I doing anything wrong in removing the object? Best
jQuery 1.4.2 element serialize not working
Hello, recently I've updated jQuery from 1.3.2 to 1.4.2 and the serialize of elements where the user can set the order just stopped working. As I googled this, I found out, that the serialization was changed in 1.4.2, but I couldn't find any example that shows how to serialize in 1.4.2 and sen the data to php where the order is saved. Here's my code that worked perfectly in 1.3.2: $("#list").sortable({ axis: 'y', handle : '.handle', update : function () { var order = $('#list').sortable('serialize');
Issue retrieving JSON results from php
Hi guys hoping someone can help me here, When running the following query I'm receiving the JS error Uncaught TypeError: Cannot read property 'ID' of null. $.getJSON( 'query/query.php', { 'task':'course_view' }, function( data ) { alert("Data Loaded: " + data.ID); } ); However when I replace the $.getJSON( with $('#content').load( I quite happily see the following JSON formatted data on my page: {"ID":"1","Name":"Test","NumberOfYears":"6"} Any ideas why getJSON doesn't appear to be
overlaying a div with a transparant layer
When a button is clicking, I want that just that secion of the page to have an overlay similar to how a modal overlay would work. Could anyone provide me with a plugin or link to the solution? Thanks.
Appending a character, to textarea.
Hi! Im using this to add text to a textarea: http://api.jquery.com/val/ How do I append a character, to where the text cursor is, in a textarea? I would like to do this so users could add special characters to their comments (like this one: ♥). thank you. this is my code: <pre> $("#special-char-1").click(function () { var text = $(this).text(); $("#comment").val(text); }); </pre>
wrapAll not working in IE8...
In order to wrap mutiple elements into one div, I use following function: // check if there is more than one table if ($('#indexen table.zoekResultaat').length > 1) { // each table has an h4 before it, and a link after it, and these three should be wrapped into the div $('#indexen h4').each(function(){ var $this = $(this); // get the three together and wrap them $this.add($this.next()).add($this.next().next()).wrapAll('<div class="tableFloater"></div>');
Flash + Jquery menu item highlight
Hi, Am having trouble getting around the following problem. Ideal situation/setup: A page containing 1 Flash movie and a separate div containing a few hyperlinks. These hyperlinks each have a unique class name like so: <ul> <li><a href="" class="randomname1"></a></li> <li><a href="" class="randomname2"></a></li> <li><a href="" class="randomname3"></a></li> <li><a href="" class="randomname4"></a></li> </ul>The Flash movie itself will contain 4 buttons. Clicking on one of these buttons should make
Checkbox will not stay checked.
Hello I'm new to jQuery and I find it to be very useful way in upgrading my forms from my website to have more functionality to them. I am having a problem with my checkboxes though. I'm trying to use a check box to show a hidden div and it works good, but when I hit the submit button to do error checking the hidden div is hidden and the check box is unchecked. Here is a sample of the code that I have. <script type="text/javascript" src="Javascript/jquery-1.4.2.js"></script> <script type="text/javascript">
content.load exponential loop
Hello, I am a beginner in JQuery, I am working at a project right now which involves an entire website being loaded on a single page and I get a weird (for me) error. http://planetzero.deusxmachina.org/ I am using wordpress as backend and an example content.load("http://planetzero.deusxmachina.org/?page_id=43"); In the upper Tier I am using JQuerryTools to make a scrollable page. The second tier is loaded through PHP The third Tier is loaded through load.content The fourth tier the same, here is
.live(submit) and ajax
When I set up a form that includes a file upload requester and do a normal form submit all the form elements are received by the server side PHP script just fine. When I try to apply this snippet below to post the same form elements via AJAX then the actual submit button and file input are missing... $("#viewtree form.dialog").live("submit", function() { var $form = $(this); $.post( $form.attr("action"), $form.serialize(), function(data, status, xhr) { $form.closest("dd").html(data);});
Connecting PasteBin.com API - AJAX Post doesnt give any response
Hi guys, I am currently developing a little widget for my forum. I want that users can easily copy & paste their code in a window and get a pastebin.com url for their source code. However, I am doing so by using jquery and it's Ajax plugin which results in getting no response. You can have a look at my source code at: http://pastebin.com/QxVKdedy Do you have any ideas why I dont get any response data? I actually read something like: Because of security reasons there is no cross browser ajax in browser
Dynamic content based on window size
I'm relatively new to javascript but been coding (html + php) for some time, so not *that* new.. I'm trying to set up a dynamic portfolio layout which utilises the viewport as a platform to see a full size image, sort of using a "background" img tag to display an image as large as the viewport will allow (keeping aspect ratio and such). I've run into a snag where when you expand the window wide enough that the image in keeping with aspect expands beyond the height and vis versa and can't figure out
Bringing an element to be visible on the screen
Hello. I have a setup where clicking on one of several spots on the screen shows one of the two forms that are hidden by default. I was wondering if there's a way to scroll the screen so this element is visible. Otherwise I can open below the fold and people will not know that something happened. The elements that I click on are not hyperlinks, jut regular divs. I was wondering if there's some method I overlooked that lets me take the page to a specific element. Thanks! Luka
Problems with my toggle function.
I have a function the opens a "ul" when the user clicks on the expandSearch div. The only problem is that the "click" is being bleeding down to the "li's" as well. I only want the click function to happen when .expandSearch is clicked not it's child element. How do I stop the trickle down effect? $('.expandSearch').click(function() { $(this).next().toggle('slow'); return false; }); <li id="unassigned" class="parent">Unassigned <ul style="display:
jQuery.ajax() GET from https to http
I am trying to grab an rss feeds xml using a GET on a https site to a http site, the get is timing out everytime. Is this even possible. If so can someone point me in the right direction so I can implement this?
Post CallBack Not Firing in 1.4.2
I hope this is an easy one, but it has me stumped. I've got an Ajax post that has been working fine with version 1.3.2 of jQuery, but when I tried it with version 1.4.2 it doesn't work. Specifically, the callback function is not firing when I define a variable equal to the function and then pass the post that variable. Thus, in the following, if I call getCustList, the agent GetCustomerListSelection will run successfully on the server, but the ShowResult function will not fire. On the other hand,
keep old content on a .load()-event error
Hi! I want to refresh the contents of a div every 2 hours (I use jQ for presentation). but I need to keep the old content until the ajax-refresh was successful. here's my code so far: //refresh page $(document).everyTime('120s', 'pagerefresh', reloadSlides, 0, true); // function function reloadSlides() { $("#pres").load("index-1.php"); } if I break my internet connection and jQuery reloads the content, the div gets cleared. I want to ensure that the old content remains in the div, even if there's
sitfinity and jquery
how i can use the jquery TabStrip in the sitfinity CMS ? or ASP pages
How to test if a html page has a parent page?
Hi, How to test if a html page has a parent page? Let me explain: I use the (great) Colorbox plugin and I like to apply jquery functions only if a page is in an Colorbox iframe. So, basically, I'd like to know how to determine with jQuery if a page has a parent page (= is in a Colorbox iframe). Any help would be greatly appreciated!
Jitter when using slideUp
Hello. I have a page with three clickable hotspots. Once one of these elements is clicked, one of the two forms is appended to it and is revealed using slideDown. If I click on a different hotspot, the currently open spot slides up and the new form slides down in a new location. here's an example url: http://test.thedebtsavers.com/index5.php However, on PC in Firefox, when the form slides up it causes elements below it to jitter like crazy. No such behavior is observed in other browsers including
jQuery opening authentication popup in 401 Unauthorized
Hi, I've found out that jquery 1.4 and 1.4.2 both make the browser show a popup when in an ajax request the server answers with 401 Unauthorized. Is there any way to change this behaviour in jquery 1.4? I want my code to process the error, not an authentication popup in the browser. As I found no way of avoiding this, I had to change to jquery 1.3.2, which calls the error function specified in the ajax request.
Find if clicked list item is before currently selected item?
I am trying to set a flag if a clicked list item is before the currently selected item in the list. Below is some partial code (the loop from another function altogether!) that shows: - CSS list ID as "#sub_menu" - selected class = "on" - "itm" is the currently clicked on list item Any help on this? THANKS in advance. function loadItem (itm) { // try to find if the clicked item is before the currently hilighted item // if so, set var goingBack = true; var prevClicked; var nowClicked; $('#sub_menu
bind a load function??
I try to load some content with help of the .load() function. this works like a charm. See my code here: $('#index').load('link.html #content', function() { $('#index').animate({'opacity':1},site_transition_speed); show_loader("hide"); });Now I want to select a dynamically loaded link. $('a').click(function(event){ event.preventDefault(); alert('highfive'); });But this doesn't work. I think I have to bind it somehow but I really don't know how. Please help me!
Modifying jQuery from default setting
Hello everyone, I'm trying to make a blog and I am facing a problem with the plugin using jQuery 'sidebarTabs'. The blog is here Paris sportifs My question is: Is it possible to display no one sub-category (none) instead of all sub-categories related to the first title ('Paris Sportifs') ? The creator of the plugin was very friendly and made me good service, but he said that it is not possible because the jQuery library by default is set to display the first sub-section ('Les bases pour débuter etc
Problem to call Method in ascx
Hi , I'm trying to call method in ascx (usercontrol) but unable to call it. I have written in 'Invitation.ascx' , <script type="text/javascript"> $(document).ready(function() { $.ajax({ type: "POST", url: "Default.aspx/AcceptInvitation", //Pass the selected record id data: "{'TID': '" + t_id + "',IID': '" + i_id + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function() { // Change the back color of the Row before deleting tr_id.css("background-color", "lightgreen");
Problem loading jQuery effects after loading content with AJAX
I have some jQuery effects that run on rollover areas on my page. These areas contain either images or text, and when you rollover them, a small bar slides up with more information. When you click on this bar that slides up, a "more info" area slides down underneath the image/text area. This all works fine so far, however I have a problem in the next part of the process. Each of these areas is a DIV nested inside another DIV. I am changing the content of the child DIV every few seconds or so with
value in text area moved when called using ajax
I'm using jquery-1.4.2 with PHP. I have a grid of records with a link to a form i'd like to use to edit the row with. The form is built using php, and works as expected when called just using a regular html link. When the form is called using $(".ajax").click(function(event), the form comes up, but the textarea(s) are messed up; <textarea>Stuff for the text area</textarea> becomes <textarea></textarea>Stuff for the text area It does this for each textarea on the form. I've looked through this
JQuery as embedded resource in ASP.NET and VS 2008
Hi, I am trying to use jquery as an embedded resource in my asp.net web site. The jquery.js and jquery-vsdoc.js file in in a folder named "Javascripts" under the root folder: myWebSite\Javascript. In my asp.net application I have a master page. I have added a script reference to jquery like this: <asp:AjaxScriptManager ID="AjaxScriptManager" runat="server" EnablePartialRendering="true" EnableScriptGlobalization="true" EnableScriptLocalization="true"> <Scripts> <asp:ScriptReference
Limiting execution time for fx ?
Hello, i use the .hover() function combined with .hide() and .show() on an image in combination with the explosion effect. The problem is that even after the effect has finished (rather fast), the effect is still "working" - i can see it with FireBug (filling HTML code), even when there is nothing to see anymore. Here is the code snippet : $(".triangle-content").hover( function(){ $(this).children(".upper-img").hide("explode", { pieces: 16 }, 1000)
SlideToggle + Cookies
Hello, I'm trying to save the state of a slideToggle. Why is my var id giving a "undefined" error? Is there a simple way to do this action (save state of slideToggle)? (I'm a javascript / jQuery newbie). $("a#toggle").click(function(){ var id = $(this).next().attr('id'); $('#'+id).slideToggle('400',function(){ if ($(this).is(':hidden')) { var state = "closed"; $.cookie('#'.id, state); return false; } else if ($(this).is(':visible')) { var state = "open"; $.cookie('#'.id,
().html HELP!!!!
Hi, Im currently developing a site which uses the Smart Cart Plugin; http://fivelist.summerhost.info/products.php?product=scat The problem is making the 'add to cart code' dynamic so i can use it with dropdown selects! This is my code here; <span>Choose Item</span> <select name="select1" id="select1" size="1"> <option value="item_1">Item 1</option> <option value="item_2">Item 2</option> </select> <script> $(document).ready(function(){ $("#divselect1").html( 'span class="hide" id="prod_name' +$('#select1').val()+
SOLVED:Flash jQuery Question
Not the best solution, but I just moved the AC_FL_RunContent scripts with the dialog code to the bottom right before the </body> tag. Now there's just blank space at the bottom, which doesn't matter. Hi, everyone. I just implemented a working Flash/PHP email form that is hidden contained in a dialog box. I'm totally psyched! Now to my problem. I love the functionality, but when I inserted the swf code into the dialog box code, a blank flash player the size of my swf pushed the rest of my website
form
hi, I am fairly new jquery and I am a bit suck here I have the following piece of JS I need to run when input elements of my form are changed. My problem is I have 3 forms on the page and I only want this to trigger for only 1 of my forms. how can I do this? $(":input").change(function(){ *} display_unsaved_data(); } I tried $("form3").(":input").change(function(){ ...} but no luck How can I do this? Thks
Next Page